Skip to content

Commit 1b4b7fe

Browse files
committed
Rename NOT_FOUND & OHTER
1 parent 1016b5a commit 1b4b7fe

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

library/Java/Lang/String/String.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ int String::indexOf(int character) const {
224224
if (found != std::string::npos) {
225225
return found;
226226
} else {
227-
return NOT_FOUND;
227+
return DO_NOT_FOUND;
228228
}
229229
}
230230

@@ -314,7 +314,7 @@ int String::lastIndexOf(String subString) const {
314314
std::reverse(currentReversedString.begin(), currentReversedString.end());
315315
std::size_t found = currentReversedString.find(reversedString.original);
316316
if (found == std::string::npos) {
317-
return NOT_FOUND;
317+
return DO_NOT_FOUND;
318318
}
319319
return ((int) this->original.size() - (int) (found + subString.original.size()));
320320
}
@@ -337,7 +337,7 @@ int String::lastIndexOf(String subString, int fromIndex) const {
337337
std::string reversedString = subString.toCharPointer();
338338
std::reverse(reversedString.begin(), reversedString.end());
339339
int result = subStringFromIndex.find(reversedString);
340-
if (result == NOT_FOUND) {
340+
if (result == DO_NOT_FOUND) {
341341
return result;
342342
}
343343

library/Java/Lang/String/StringTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ TEST (JavaLangString, LastIndexOf) {
530530

531531
// Test false with wrong subString
532532
result = validString.lastIndexOf(wrongString);
533-
assertEquals(NOT_FOUND, result);
533+
assertEquals(DO_NOT_FOUND, result);
534534
}
535535

536536
{

library/Kernel/Type.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#ifndef NATIVE_TYPE_HPP
2828
#define NATIVE_TYPE_HPP
2929

30-
#define NOT_FOUND -1
30+
#define DO_NOT_FOUND -1
3131
#define MAX_STRING_LENGTH 100000
3232

3333
#ifdef WIN
@@ -58,7 +58,7 @@ typedef unsigned char byte;
5858
#define DOUBLE 16
5959
#define CHAR_POINTER 17
6060
#define INT_POINTER 18
61-
#define OTHER 19
61+
#define DEFAULT 19
6262

6363
#define typename(x) _Generic((x), \
6464
_Bool: _BOOL, unsigned char: UNSIGNED_CHAR, \
@@ -70,6 +70,6 @@ long long int: LONG_LONG_INT, unsigned long long int: UNSIGNED_LONG_LONG_INT, \
7070
float: FLOAT, double: DOUBLE, \
7171
long double: LONG_DOUBLE, char *: CHAR_POINTER, \
7272
void *: VOID_POINTER, int *: INT_POINTER, \
73-
default: OTHER)
73+
default: DEFAULT)
7474

7575
#endif//NATIVE_TYPE_HPP

0 commit comments

Comments
 (0)