Changeset 2908 in josm for trunk/src/org


Ignore:
Timestamp:
2010-01-30T20:46:40+01:00 (15 years ago)
Author:
jttt
Message:

Improve gpx loading performance

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/gpx/WayPoint.java

    r2907 r2908  
    1818    public boolean drawLine;
    1919    public int dir;
     20
     21    private static ThreadLocal<PrimaryDateParser> dateParser = new ThreadLocal<PrimaryDateParser>() {
     22        @Override protected PrimaryDateParser initialValue() {
     23            return new PrimaryDateParser();
     24        }
     25    };
    2026
    2127    private final CachedLatLon coor;
     
    4349    public void setTime() {
    4450        if(attr.containsKey("time")) {
    45             PrimaryDateParser dateParser = new PrimaryDateParser();
    4651            try {
    47                 time = dateParser.parse(attr.get("time").toString()).getTime() / 1000.; /* ms => seconds */
     52                time = dateParser.get().parse(attr.get("time").toString()).getTime() / 1000.; /* ms => seconds */
    4853            } catch(Exception e) {
    4954                time = 0;
Note: See TracChangeset for help on using the changeset viewer.