Make position1 and position2 constant variables in main.cpp
This commit is contained in:
parent
b351280b5b
commit
0b20c24eba
|
@ -49,14 +49,14 @@ int main(int argc, char* argv[]) {
|
||||||
resultingPair.first = compile(fileName);
|
resultingPair.first = compile(fileName);
|
||||||
} catch (const Yerbacon::Exception& error) {
|
} catch (const Yerbacon::Exception& error) {
|
||||||
unsigned long lastSlash = 0;
|
unsigned long lastSlash = 0;
|
||||||
unsigned long position1 = fileName.find_last_of('/');
|
const unsigned long position1 = fileName.find_last_of('/');
|
||||||
const bool isNPOS = cmp_equal(position1, string_view::npos)
|
const bool isNPOS = cmp_equal(position1, string_view::npos)
|
||||||
if constexpr(filesystem::path::preferred_separator == '/') {
|
if constexpr(filesystem::path::preferred_separator == '/') {
|
||||||
if (not isNPOS) {
|
if (not isNPOS) {
|
||||||
lastSlash = position1;
|
lastSlash = position1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
unsigned long position2 = fileName.find_last_of(filesystem::path::preferred_separator);
|
const unsigned long position2 = fileName.find_last_of(filesystem::path::preferred_separator);
|
||||||
if (cmp_not_equal(position2, string_view::npos)) {
|
if (cmp_not_equal(position2, string_view::npos)) {
|
||||||
lastSlash = (isNPOS) ? position2 : max(position1, position2);
|
lastSlash = (isNPOS) ? position2 : max(position1, position2);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue