File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -141,11 +141,15 @@ namespace semver
141
141
142
142
prerelease_descriptor increment () const {
143
143
std::vector<prerelease_part> new_parts = (m_parts);
144
- int last_numeric_index = -1 ;
144
+ size_t last_numeric_index = 0 ;
145
+ bool last_numeric_index_found = false ;
145
146
for (size_t i = 0 ; i < new_parts.size (); ++i) {
146
- if (new_parts[i].numeric ()) last_numeric_index = i;
147
+ if (new_parts[i].numeric ()){
148
+ last_numeric_index = i;
149
+ last_numeric_index_found = true ;
150
+ }
147
151
}
148
- if (last_numeric_index != - 1 ) {
152
+ if (last_numeric_index_found ) {
149
153
prerelease_part last = new_parts[last_numeric_index];
150
154
new_parts[last_numeric_index] = prerelease_part (std::to_string (last.numeric_value () + 1 ));
151
155
} else {
You can’t perform that action at this time.
0 commit comments