From 28d221897e0587dfb8ad8cf4af77bce900d9f452 Mon Sep 17 00:00:00 2001 From: Aarik Pokras <85502246+aarikpokras@users.noreply.github.com> Date: Sun, 24 Nov 2024 11:18:40 -0500 Subject: [PATCH] Change to `string::npos` for compatibility --- src/fa.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fa.cpp b/src/fa.cpp index b746cbc..b605d98 100644 --- a/src/fa.cpp +++ b/src/fa.cpp @@ -9,8 +9,8 @@ size_t find_a(string str) { size_t index = str.find(","); amt++; str.erase(0, index+1); - if (index > str.size()) { // Change to string::npos for compat - amt++; // If no match (returns very large number), add to amt and return + if (index == string::npos) { + amt++; return amt; } }