From 6723c2df0d6cadbab2d36845ca3a1a2b98b69273 Mon Sep 17 00:00:00 2001 From: Silas Wrinker Date: Mon, 22 Jul 2024 16:19:25 -0400 Subject: [PATCH] Update extralex.cpp --- src/crate/extralex.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/crate/extralex.cpp b/src/crate/extralex.cpp index 7335281..7431762 100644 --- a/src/crate/extralex.cpp +++ b/src/crate/extralex.cpp @@ -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); }); }