diff options
| author | levlam <levlam@telegram.org> | 2021-11-01 01:24:51 +0300 |
|---|---|---|
| committer | levlam <levlam@telegram.org> | 2021-11-01 01:24:51 +0300 |
| commit | c66cf3dec6c23016ef44fed9a888053f2f5fc9ce (patch) | |
| tree | f0692da5d737a00e9dac374a2beab7cb7eb2efb7 /tdtl/td | |
| parent | 7cd7e5afd38cb32439ecad62bb81c5bb8eb26a8a (diff) | |
Use range-based for on arrays/strings if possible.
Diffstat (limited to 'tdtl/td')
| -rw-r--r-- | tdtl/td/tl/tl_simple.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tdtl/td/tl/tl_simple.h b/tdtl/td/tl/tl_simple.h index 67ad2a1aa..7647981bf 100644 --- a/tdtl/td/tl/tl_simple.h +++ b/tdtl/td/tl/tl_simple.h @@ -23,9 +23,9 @@ namespace tl { namespace simple { inline std::string gen_cpp_name(std::string name) { - for (std::size_t i = 0; i < name.size(); i++) { - if ((name[i] < '0' || '9' < name[i]) && (name[i] < 'a' || 'z' < name[i]) && (name[i] < 'A' || 'Z' < name[i])) { - name[i] = '_'; + for (auto &c : name) { + if ((c < '0' || '9' < c) && (c < 'a' || 'z' < c) && (c < 'A' || 'Z' < c)) { + c = '_'; } } assert(!name.empty()); |
