[analyzer] Remove comparePath's dependency on subscript operator.

llvm-svn: 180740
This commit is contained in:
Ted Kremenek 2013-04-29 22:38:22 +00:00
parent 96a77693be
commit 518e781256
1 changed files with 7 additions and 2 deletions

View File

@ -297,11 +297,16 @@ static Optional<bool> comparePiece(const PathDiagnosticPiece &X,
static Optional<bool> comparePath(const PathPieces &X, const PathPieces &Y) {
if (X.size() != Y.size())
return X.size() < Y.size();
for (unsigned i = 0, n = X.size(); i != n; ++i) {
Optional<bool> b = comparePiece(*X[i], *Y[i]);
PathPieces::const_iterator X_I = X.begin(), X_end = X.end();
PathPieces::const_iterator Y_I = Y.begin(), Y_end = Y.end();
for ( ; X_I != X_end && Y_I != Y_end; ++X_I, ++Y_I) {
Optional<bool> b = comparePiece(**X_I, **Y_I);
if (b.hasValue())
return b.getValue();
}
return None;
}