From c1fb3f548ce16938675ab01c29254fc79c03f8dc Mon Sep 17 00:00:00 2001 From: ales stibal Date: Mon, 15 Jul 2024 23:00:32 +0200 Subject: [PATCH] shmauth - use internal standard function to split a string --- src/shm/shmauth.hpp | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/src/shm/shmauth.hpp b/src/shm/shmauth.hpp index 61133429..13faa5d8 100644 --- a/src/shm/shmauth.hpp +++ b/src/shm/shmauth.hpp @@ -259,22 +259,9 @@ struct IdentityInfoType : public IdentityInfoBase { int pos = 0; int old_pos = 0; - while(true) { - pos = groups.find("+",pos); - if(pos > old_pos && pos != static_cast(std::string::npos)) { - std::string x = groups.substr(old_pos,pos-old_pos); - groups_vec.push_back(x); - - old_pos = pos + 1; - pos++; - groups.find('+',pos); - } else { - std::string x = groups.substr(old_pos,groups.size()-old_pos); - groups_vec.push_back(x); - break; - } - } - } + + groups_vec = string_split(groups, '+'); + } };