Skip to content

Commit 9e8dec4

Browse files
tdp2110braxtonmckee
authored andcommitted
StringType::cmpStatic: fix accidental reference to std::right
Because of the `using namespace std` directive at the top of StringType.cpp, within `StringType::cmpStatic`, `right` is resolved to the function `std::right`, from the <ios> header, included indirectly by <iostream>. `std::right`, a function, is always non-null. The intention here was clearly to use the parameter `right_data`, not `std::right`. Fix that bug.
1 parent 79fa251 commit 9e8dec4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

typed_python/StringType.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,13 +1444,13 @@ char StringType::cmpStatic(layout* left, layout* right) {
14441444
}
14451445

14461446
char StringType::cmpStatic(layout* left, uint8_t* right_data, int right_pointcount, int right_bytes_per_codepoint) {
1447-
if ( !left && !right ) {
1447+
if ( !left && !right_data ) {
14481448
return 0;
14491449
}
1450-
if ( !left && right ) {
1450+
if ( !left && right_data ) {
14511451
return -1;
14521452
}
1453-
if ( left && !right ) {
1453+
if ( left && !right_data ) {
14541454
return 1;
14551455
}
14561456

0 commit comments

Comments
 (0)