Ticket #3347: speedup-main.patch

File speedup-main.patch, 968 bytes (added by bilbo, 16 years ago)

Speedup patch part 1 (core)

  • src/org/openstreetmap/josm/data/UndoRedoHandler.java

     
    3535    /**
    3636     * Execute the command and add it to the intern command queue.
    3737     */
    38     public void add(final Command c) {
     38    public void addNoRedraw(final Command c) {
    3939        c.executeCommand();
    4040        commands.add(c);
    4141        redoCommands.clear();
     42    }
     43
     44    public void afterAdd() {
    4245        if (Main.map != null && Main.map.mapView.getActiveLayer() instanceof OsmDataLayer) {
    4346            OsmDataLayer data = (OsmDataLayer)Main.map.mapView.getActiveLayer();
    4447            data.fireDataChange();
     
    5053    }
    5154
    5255    /**
     56     * Execute the command and add it to the intern command queue.
     57     */
     58    public void add(final Command c) {
     59        addNoRedraw(c);
     60        afterAdd();
     61    }
     62
     63    /**
    5364     * Undoes the last added command.
    5465     */
    5566    public void undo() {