Skip to content

Commit 0cf5358

Browse files
jbachorikclaude
andcommitted
Move startsWith to file-scope inline utility
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent 40950e6 commit 0cf5358

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

ddprof-lib/src/main/cpp/vmStructs.h

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -830,17 +830,16 @@ DECLARE(VMMethod)
830830
static bool check_jmethodID(jmethodID id);
831831
DECLARE_END
832832

833-
DECLARE(VMNMethod)
834-
private:
835-
// Inline string comparison to avoid indirect call to strncmp
836-
template<size_t N>
837-
static bool startsWith(const char* s, const char (&pattern)[N]) {
838-
for (size_t i = 0; i < N - 1; i++) {
839-
if (s[i] != pattern[i]) return false;
840-
}
841-
return true;
833+
// Inline string comparison to avoid indirect call to strncmp
834+
template<size_t N>
835+
static inline bool startsWith(const char* s, const char (&pattern)[N]) {
836+
for (size_t i = 0; i < N - 1; i++) {
837+
if (s[i] != pattern[i]) return false;
842838
}
839+
return true;
840+
}
843841

842+
DECLARE(VMNMethod)
844843
public:
845844
int size() {
846845
assert(_blob_size_offset >= 0);

0 commit comments

Comments
 (0)