diff options
| author | ckgt <ckarlsson25@gmail.com> | 2019-05-03 11:17:09 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-05-03 11:17:09 -0400 |
| commit | af1651176e142d10b113d2fc322076917414db3c (patch) | |
| tree | e658fd1bdb94d26deda65cbbdf39fe82c10c4dee /src/NMEAParser.cpp | |
| parent | d8e490622a2693b4b49598d194aab1139d4e821b (diff) | |
| parent | 5dc9ecc44740c34247076e1c26aa5b00f06595ea (diff) | |
Merge pull request #7 from SunBlack/readability-container-size-empty
via u/SunBlack: Check for empty container via .empty() instead of with .size()
Diffstat (limited to 'src/NMEAParser.cpp')
| -rw-r--r-- | src/NMEAParser.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/NMEAParser.cpp b/src/NMEAParser.cpp index e7b0901..edccb6f 100644 --- a/src/NMEAParser.cpp +++ b/src/NMEAParser.cpp @@ -216,7 +216,7 @@ void NMEAParser::readSentence(std::string cmd){ onInfo(nmea, "Processing NEW string..."); - if (cmd.size() == 0){ + if (cmd.empty()){ onWarning(nmea, "Blank string -- Skipped processing."); return; } @@ -323,7 +323,7 @@ uint8_t NMEAParser::calculateChecksum(string s){ void NMEAParser::parseText(NMEASentence& nmea, string txt){ - if (txt.size() == 0){ + if (txt.empty()){ nmea.isvalid = false; return; } @@ -364,7 +364,7 @@ void NMEAParser::parseText(NMEASentence& nmea, string txt){ // Handle comma edge cases size_t comma = txt.find(','); if (comma == string::npos){ //comma not found, but there is a name... - if (txt.size() > 0) + if (!txt.empty()) { // the received data must just be the name if ( hasNonAlphaNum(txt) ){ nmea.isvalid = false; |
