Skip to content

Commit

Permalink
Auto-generate files after cl/703267593
Browse files Browse the repository at this point in the history
  • Loading branch information
protobuf-team-bot committed Dec 5, 2024
1 parent aac2600 commit c02d5ef
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions php/ext/google/protobuf/php-upb.h
Original file line number Diff line number Diff line change
Expand Up @@ -1208,6 +1208,16 @@ UPB_INLINE bool upb_StringView_IsEqual(upb_StringView a, upb_StringView b) {
return (a.size == b.size) && (!a.size || !memcmp(a.data, b.data, a.size));
}

// Compares StringViews following strcmp rules.
// Please note this comparison is neither unicode nor locale aware.
UPB_INLINE int upb_StringView_Compare(upb_StringView a, upb_StringView b) {
int result = memcmp(a.data, b.data, UPB_MIN(a.size, b.size));
if (result == 0) {
return a.size - b.size;
}
return result;
}

// LINT.ThenChange(
// GoogleInternalName1,
// //depot/google3/third_party/upb/bits/golang/accessor.go:map_go_string,
Expand Down
10 changes: 10 additions & 0 deletions ruby/ext/google/protobuf_c/ruby-upb.h
Original file line number Diff line number Diff line change
Expand Up @@ -1210,6 +1210,16 @@ UPB_INLINE bool upb_StringView_IsEqual(upb_StringView a, upb_StringView b) {
return (a.size == b.size) && (!a.size || !memcmp(a.data, b.data, a.size));
}

// Compares StringViews following strcmp rules.
// Please note this comparison is neither unicode nor locale aware.
UPB_INLINE int upb_StringView_Compare(upb_StringView a, upb_StringView b) {
int result = memcmp(a.data, b.data, UPB_MIN(a.size, b.size));
if (result == 0) {
return a.size - b.size;
}
return result;
}

// LINT.ThenChange(
// GoogleInternalName1,
// //depot/google3/third_party/upb/bits/golang/accessor.go:map_go_string,
Expand Down

0 comments on commit c02d5ef

Please sign in to comment.