Skip to content

Commit 12b88ef

Browse files
author
Steve Hanson
committed
fix coverage again
1 parent f6ebcb2 commit 12b88ef

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

include/rapidjson/uri.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -417,11 +417,8 @@ class GenericUri {
417417
if (slashpos == 2 && path_[pathpos] == '.' && path_[pathpos + 1] == '.') {
418418
// Backup a .. segment in the new path_
419419
// We expect to find a previously added slash at the end or nothing
420+
RAPIDJSON_ASSERT(newpos == 0 || path_[newpos - 1] == '/');
420421
size_t lastslashpos = newpos;
421-
while (lastslashpos > 0) {
422-
if (path_[lastslashpos - 1] == '/') break;
423-
lastslashpos--;
424-
}
425422
// Make sure we don't go beyond the start segment
426423
if (lastslashpos > 1) {
427424
// Find the next to last slash and back up to it

0 commit comments

Comments
 (0)