Skip to content

Commit

Permalink
Update extralex.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
silas-wr authored Jul 22, 2024
1 parent d104079 commit 6723c2d
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/crate/extralex.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
#include "crate.hpp"

bool isUpper(string s) {
for (int i = 0; i < s.size(); i++) {
if (isupper(s.at(i))) {
;
} else {
return false; // not uppercase
}
}

return true; // no characters caused a false to be returned; thus, it must be uppercase
bool isUpper(const string& s) {
return all_of(s.begin(), s.end(), [](unsigned char c){ return isupper(c); });
}

0 comments on commit 6723c2d

Please sign in to comment.