@@ -163,56 +163,6 @@ bool UriUtils::get_last_uri_component(std::string_view const uri, std::string& n
163163 return true ;
164164}
165165
166- bool StringUtils::get_bounds_of_next_var (string const & msg, size_t & begin_pos, size_t & end_pos) {
167- auto const msg_length = msg.length ();
168- if (end_pos >= msg_length) {
169- return false ;
170- }
171-
172- while (true ) {
173- begin_pos = end_pos;
174- // Find next non-delimiter
175- for (; begin_pos < msg_length; ++begin_pos) {
176- if (false == is_delim (msg[begin_pos])) {
177- break ;
178- }
179- }
180- if (msg_length == begin_pos) {
181- // Early exit for performance
182- return false ;
183- }
184-
185- bool contains_decimal_digit = false ;
186- bool contains_alphabet = false ;
187-
188- // Find next delimiter
189- end_pos = begin_pos;
190- for (; end_pos < msg_length; ++end_pos) {
191- char c = msg[end_pos];
192- if (clp::string_utils::is_decimal_digit (c)) {
193- contains_decimal_digit = true ;
194- } else if (clp::string_utils::is_alphabet (c)) {
195- contains_alphabet = true ;
196- } else if (is_delim (c)) {
197- break ;
198- }
199- }
200-
201- // Treat token as variable if:
202- // - it contains a decimal digit, or
203- // - it's directly preceded by an equals sign and contains an alphabet, or
204- // - it could be a multi-digit hex value
205- if (contains_decimal_digit
206- || (begin_pos > 0 && ' =' == msg[begin_pos - 1 ] && contains_alphabet)
207- || could_be_multi_digit_hex_value (msg, begin_pos, end_pos))
208- {
209- break ;
210- }
211- }
212-
213- return (msg_length != begin_pos);
214- }
215-
216166void StringUtils::escape_json_string (std::string& destination, std::string_view const source) {
217167 // Escaping is implemented using this `append_unescaped_slice` approach to offer a fast path
218168 // when strings are mostly or entirely valid escaped JSON. Benchmarking shows that this offers
0 commit comments