From 33b8d8cfd78babcc4dd022c395cb840c674c40ec Mon Sep 17 00:00:00 2001 From: dcb314 Date: Tue, 14 Nov 2023 08:30:29 +0000 Subject: [PATCH] Update Effect.cpp Four small speed improvements. No functional change. --- src/Effect.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Effect.cpp b/src/Effect.cpp index b775c71ea..c7f76b5d6 100644 --- a/src/Effect.cpp +++ b/src/Effect.cpp @@ -343,7 +343,7 @@ Effect::is_read(string vname) const string tmp = vname; do { pos = tmp.find_last_of("."); - tmp = tmp.substr(0, pos); + tmp.resize(pos); if (tmp == rname) { return true; } @@ -354,7 +354,7 @@ Effect::is_read(string vname) const string tmp = rname; do { pos = tmp.find_last_of("."); - tmp = tmp.substr(0, pos); + tmp.resize(pos); if (tmp == vname) { return true; } @@ -405,7 +405,7 @@ Effect::is_written(string vname) const string tmp = vname; do { pos = tmp.find_last_of("."); - tmp = tmp.substr(0, pos); + tmp.resize(pos); if (tmp == wname) { return true; } @@ -416,7 +416,7 @@ Effect::is_written(string vname) const string tmp = wname; do { pos = tmp.find_last_of("."); - tmp = tmp.substr(0, pos); + tmp.resize(pos); if (tmp == vname) { return true; }