Compare commits
2 Commits
d1a3538e9a
...
6cc6e9e7ed
| Author | SHA1 | Date | |
|---|---|---|---|
| 6cc6e9e7ed | |||
| de859bef77 |
+1
-1
@@ -42,7 +42,7 @@ constexpr char toUpper(char const c) noexcept {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
constexpr int caseInsensitiveEquals(ox::StringViewCR a, ox::StringViewCR b) noexcept {
|
constexpr int caseInsensitiveStrCmp(StringViewCR a, StringViewCR b) noexcept {
|
||||||
auto const sz = ox::min(a.size(), b.size());
|
auto const sz = ox::min(a.size(), b.size());
|
||||||
for (size_t i{}; i < sz; ++i) {
|
for (size_t i{}; i < sz; ++i) {
|
||||||
auto const ac = toUpper(a[i]);
|
auto const ac = toUpper(a[i]);
|
||||||
|
|||||||
@@ -36,9 +36,9 @@ static void printUsage() noexcept {
|
|||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
static constexpr ox::Result<ox::ClawFormat> getFmt(ox::StringViewCR fmtStr) noexcept {
|
static constexpr ox::Result<ox::ClawFormat> getFmt(ox::StringViewCR fmtStr) noexcept {
|
||||||
if (caseInsensitiveEquals(fmtStr, "mc") == 0) {
|
if (caseInsensitiveStrCmp(fmtStr, "mc") == 0) {
|
||||||
return ox::ClawFormat::Metal;
|
return ox::ClawFormat::Metal;
|
||||||
} else if (caseInsensitiveEquals(fmtStr, "oc") == 0) {
|
} else if (caseInsensitiveStrCmp(fmtStr, "oc") == 0) {
|
||||||
return ox::ClawFormat::Organic;
|
return ox::ClawFormat::Organic;
|
||||||
}
|
}
|
||||||
return ox::Error{1, "invalid format"};
|
return ox::Error{1, "invalid format"};
|
||||||
|
|||||||
Reference in New Issue
Block a user