Ignore:
Timestamp:
2013-07-26T10:36:15+02:00 (11 years ago)
Author:
bastiK
Message:

see #8902 - Small performance enhancements (patch by shinigami)

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/MainApplication.java

    r6070 r6083  
    181181        }
    182182
    183         Getopt g = new Getopt("JOSM", args, "hv", los.toArray(new LongOpt[0]));
     183        Getopt g = new Getopt("JOSM", args, "hv", los.toArray(new LongOpt[los.size()]));
    184184
    185185        Map<Option, Collection<String>> argMap = new HashMap<Option, Collection<String>>();
  • trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r6070 r6083  
    524524                SeparatorLayerAction.INSTANCE,
    525525                new LayerListPopup.InfoAction(this)}));
    526         return actions.toArray(new Action[0]);
     526        return actions.toArray(new Action[actions.size()]);
    527527    }
    528528
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java

    r5901 r6083  
    301301        entries.add(new LayerListPopup.InfoAction(this));
    302302
    303         return entries.toArray(new Action[0]);
     303        return entries.toArray(new Action[entries.size()]);
    304304
    305305    }
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java

    r6070 r6083  
    530530                Color bkground = new Color(255, 255, 255, 128);
    531531                int lastPos = 0;
    532                 int pos = osdText.indexOf("\n");
     532                int pos = osdText.indexOf('\n');
    533533                int x = 3;
    534534                int y = 3;
     
    543543                    y += (int) lineSize.getHeight();
    544544                    lastPos = pos + 1;
    545                     pos = osdText.indexOf("\n", lastPos);
     545                    pos = osdText.indexOf('\n', lastPos);
    546546                }
    547547
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/ImportAudioAction.java

    r6070 r6083  
    249249                wayPointFromTimeStamp.time = startTime;
    250250                String name = wavFile.getName();
    251                 int dot = name.lastIndexOf(".");
     251                int dot = name.lastIndexOf('.');
    252252                if (dot > 0) {
    253253                    name = name.substring(0, dot);
  • trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java

    r5762 r6083  
    252252        components.add(SeparatorLayerAction.INSTANCE);
    253253        components.add(new LayerListPopup.InfoAction(this));
    254         return components.toArray(new Action[0]);
     254        return components.toArray(new Action[components.size()]);
    255255    }
    256256
  • trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java

    r6070 r6083  
    165165        {
    166166            String[] a;
    167             if(fileset.indexOf("=") >= 0) {
     167            if(fileset.indexOf('=') >= 0) {
    168168                a = fileset.split("=", 2);
    169169            } else {
  • trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSourceHandler.java

    r3894 r6083  
    5252    Color convertColor(String colString)
    5353    {
    54         int i = colString.indexOf("#");
     54        int i = colString.indexOf('#');
    5555        Color ret;
    5656        if (i < 0) {
  • trunk/src/org/openstreetmap/josm/gui/oauth/TestAccessTokenTask.java

    r5587 r6083  
    9292        // remove trailing slashes
    9393        while(url.endsWith("/")) {
    94             url = url.substring(0, url.lastIndexOf("/"));
     94            url = url.substring(0, url.lastIndexOf('/'));
    9595        }
    9696        return url;
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java

    r6070 r6083  
    349349                for (File f: new File(".").listFiles()) {
    350350                   String s = f.getName();
    351                    int idx = s.indexOf("_");
     351                   int idx = s.indexOf('_');
    352352                   if (idx>=0) {
    353353                        String t=s.substring(0,idx);
     
    359359                for (File f: Main.pref.getPreferencesDirFile().listFiles()) {
    360360                   String s = f.getName();
    361                    int idx = s.indexOf("_");
     361                   int idx = s.indexOf('_');
    362362                   if (idx>=0) {
    363363                        String t=s.substring(0,idx);
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/UTMProjectionChoice.java

    r6070 r6083  
    110110            }
    111111        }
    112         return projections.toArray(new String[0]);
     112        return projections.toArray(new String[projections.size()]);
    113113    }
    114114
     
    134134
    135135        if(args != null) {
    136             String[] array = args.toArray(new String[0]);
     136            String[] array = args.toArray(new String[args.size()]);
    137137
    138138            if (array.length > 1) {
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/ApiUrlTestTask.java

    r5926 r6083  
    157157        String apiUrl = url.trim();
    158158        while(apiUrl.endsWith("/")) {
    159             apiUrl = apiUrl.substring(0, apiUrl.lastIndexOf("/"));
     159            apiUrl = apiUrl.substring(0, apiUrl.lastIndexOf('/'));
    160160        }
    161161        return apiUrl;
Note: See TracChangeset for help on using the changeset viewer.