Skip to content

Commit e8db92e

Browse files
authored
Merge pull request #3214 from gberkes/v3/Use_the_init-statement_to_declare_pos_inside_the_if_statement
Refactor: used the init-statement to declare "pos" inside the if statement
2 parents a3ffc5a + ab78d4a commit e8db92e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/variables/remote_user.cc

+1-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ void RemoteUser::evaluate(Transaction *transaction,
5656

5757
base64 = Utils::Base64::decode(base64);
5858

59-
const auto pos = base64.find(":");
60-
if (pos != std::string::npos) {
59+
if (const auto pos{base64.find(":")}; pos != std::string::npos) {
6160
transaction->m_variableRemoteUser.assign(std::string(base64, 0, pos));
6261

6362
auto var = std::make_unique<VariableValue>(&v->getKeyWithCollection(),

0 commit comments

Comments
 (0)