Skip to content

Commit

Permalink
Make CachedEdgeList neighbours/incident edges const.
Browse files Browse the repository at this point in the history
This should avoid the case that a user accidentally or deliberately
overwrites the internally cached values.
  • Loading branch information
WebDrake committed Nov 25, 2013
1 parent 141c8e2 commit 34d6cfa
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions source/dgraph/graph.d
Original file line number Diff line number Diff line change
Expand Up @@ -592,15 +592,15 @@ final class CachedEdgeList(bool dir)

static if (directed)
{
size_t[][] _incidentEdgesIn;
size_t[][] _incidentEdgesOut;
size_t[][] _neighboursIn;
size_t[][] _neighboursOut;
const(size_t)[][] _incidentEdgesIn;
const(size_t)[][] _incidentEdgesOut;
const(size_t)[][] _neighboursIn;
const(size_t)[][] _neighboursOut;
}
else
{
size_t[][] _incidentEdges;
size_t[][] _neighbours;
const(size_t)[][] _incidentEdges;
const(size_t)[][] _neighbours;
}

public:
Expand Down

0 comments on commit 34d6cfa

Please sign in to comment.