gravatar
alpar (Alpar Juttner)
alpar@cs.elte.hu
Merge #184
0 2 0
merge default
0 files changed with 7 insertions and 4 deletions:
↑ Collapse diff ↑
Show white space 6 line context
... ...
@@ -19,2 +19,3 @@
19 19
	cmake/FindCOIN.cmake \
20
	cmake/LEMONConfig.cmake.in \
20 21
	cmake/version.cmake.in \
Ignore white space 6 line context
... ...
@@ -1017,6 +1017,7 @@
1017 1017
  ///
1018
  /// This function returns the source of the given path.
1018
  /// This function returns the source node of the given path.
1019
  /// If the path is empty, then it returns \c INVALID.
1019 1020
  template <typename Digraph, typename Path>
1020 1021
  typename Digraph::Node pathSource(const Digraph& digraph, const Path& path) {
1021
    return digraph.source(path.front());
1022
    return path.empty() ? INVALID : digraph.source(path.front());
1022 1023
  }
... ...
@@ -1025,6 +1026,7 @@
1025 1026
  ///
1026
  /// This function returns the target of the given path.
1027
  /// This function returns the target node of the given path.
1028
  /// If the path is empty, then it returns \c INVALID.
1027 1029
  template <typename Digraph, typename Path>
1028 1030
  typename Digraph::Node pathTarget(const Digraph& digraph, const Path& path) {
1029
    return digraph.target(path.back());
1031
    return path.empty() ? INVALID : digraph.target(path.back());
1030 1032
  }
0 comments (0 inline)