From acf02145776be81ad6431ddf7f5a1666ab23ffa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Wed, 22 Feb 2023 19:20:34 -0800 Subject: [PATCH] Cleanup. --- include/bx/string.h | 11 ++++++++++- src/string.cpp | 14 +++++++------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/include/bx/string.h b/include/bx/string.h index 1cd070e..73f02a3 100644 --- a/include/bx/string.h +++ b/include/bx/string.h @@ -129,7 +129,16 @@ namespace bx int32_t m_capacity; }; - /// Returns true if character is part of space set. + /// Returns true if character is part of white space set. + /// + /// White space set is: + /// ' ' - Space. + /// '\t' - Horizontal tab. + /// '\n' - Line feed / new line. + /// '\r' - Carriage return. + /// '\v' - Vertical tab. + /// '\f' - Form feed / new page. + /// bool isSpace(char _ch); /// Returns true if string view contains only space characters. diff --git a/src/string.cpp b/src/string.cpp index 538d4b6..06446e2 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -17,12 +17,12 @@ namespace bx bool isSpace(char _ch) { - return ' ' == _ch - || '\t' == _ch - || '\n' == _ch - || '\v' == _ch - || '\f' == _ch - || '\r' == _ch + return ' ' == _ch // Space. + || '\t' == _ch // Horizontal tab. + || '\n' == _ch // Line feed / new line. + || '\r' == _ch // Carriage return. + || '\v' == _ch // Vertical tab. + || '\f' == _ch // Form feed / new page. ; } @@ -544,7 +544,7 @@ namespace bx return StringView(ptr, ii + 1); } } - + return StringView(_str.getPtr(), _str.getPtr()); }