Changeset 5dc8d4


Ignore:
Timestamp:
07/09/12 11:27:51 (11 months ago)
Author:
Tiago de Paula Peixoto <tiago@…>
Branches:
master
Children:
03248e
Parents:
6d6107
git-author:
Tiago de Paula Peixoto <tiago@…> (07/09/12 11:27:51)
git-committer:
Tiago de Paula Peixoto <tiago@…> (07/09/12 11:27:51)
Message:
Optimize validation of edge descriptors.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/graph/graph_python_interface.hh

    r6b959e r5dc8d4  
    261261        bool valid = PythonVertex(_g, source(e, gi._state->_mg)).IsValid() && 
    262262            PythonVertex(_g, target(e, gi._state->_mg)).IsValid(); 
    263         if (!valid) 
    264             return false; 
    265         valid = false; 
    266         graph_traits<GraphInterface::multigraph_t>::out_edge_iterator ei, ei_end; 
    267         for (tie(ei, ei_end) = out_edges(source(e, gi._state->_mg), gi._state->_mg); 
    268              ei != ei_end; ++ei) 
    269             if (*ei == e) 
    270                 valid = true; 
     263 
     264        if (valid) 
     265            valid = gi.GetEdgeIndex()[e] <= gi.GetMaxEdgeIndex(); 
    271266        return valid; 
    272267    } 
Note: See TracChangeset for help on using the changeset viewer.