Ignore:
Timestamp:
2012-04-14T17:31:42+02:00 (13 years ago)
Author:
joshdoe
Message:

[josm_utilsplugin2] Check iteration count to prevent endless loop with Replace Geometry (#josm7295)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/utilsplugin2/src/edu/princeton/cs/algs4/DijkstraSP.java

    r28116 r28298  
    4848        pq = new IndexMinPQ<Double>(G.V());
    4949        pq.insert(s, distTo[s]);
     50        int count = 0;
    5051        while (!pq.isEmpty()) {
    5152            int v = pq.delMin();
    5253            for (DirectedEdge e : G.adj(v))
    5354                relax(e);
     55            count++;
     56            if (count > G.V())
     57                throw new RuntimeException("Exceeded limit");
    5458        }
    5559
Note: See TracChangeset for help on using the changeset viewer.