Skip to content

Commit 005bf34

Browse files
committed
Merge pull request #1371 from drewwells/feature/stringnpos
access npos member constant from string
2 parents 0c75f18 + 06393c6 commit 005bf34

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/plugins.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
#include "output.hpp"
1212
#include "plugins.hpp"
1313

14-
#define npos string::npos
15-
1614
namespace Sass {
1715

1816
Plugins::Plugins(void) { }
@@ -31,10 +29,10 @@ namespace Sass {
3129

3230
// find the position of the second dot
3331
size_t pos = string(our_version).find('.', 0);
34-
if (pos != npos) pos = string(our_version).find('.', pos + 1);
32+
if (pos != string::npos) pos = string(our_version).find('.', pos + 1);
3533

3634
// if we do not have two dots we fallback to compare complete string
37-
if (pos == npos) { return strcmp(their_version, our_version) ? 0 : 1; }
35+
if (pos == string::npos) { return strcmp(their_version, our_version) ? 0 : 1; }
3836
// otherwise only compare up to the second dot (major versions)
3937
else { return strncmp(their_version, our_version, pos) ? 0 : 1; }
4038

@@ -165,4 +163,3 @@ namespace Sass {
165163
}
166164

167165
}
168-

0 commit comments

Comments
 (0)