Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into generic_app_ctx_3221
Browse files Browse the repository at this point in the history
  • Loading branch information
ReneWerner87 committed Jan 30, 2025
2 parents d6b57b5 + f5b7a12 commit 7dc7728
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
9 changes: 0 additions & 9 deletions helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -728,15 +728,6 @@ func IsMethodIdempotent(m string) bool {
}
}

func IndexRune(str string, needle int32) bool {
for _, b := range str {
if b == needle {
return true
}
}
return false
}

// Convert a string value to a specified type, handling errors and optional default values.
func Convert[T any](value string, convertor func(string) (T, error), defaultValue ...T) (T, error) {
converted, err := convertor(value)
Expand Down
4 changes: 2 additions & 2 deletions helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -625,13 +625,13 @@ func Benchmark_SlashRecognition(b *testing.B) {
}
require.True(b, result)
})
b.Run("IndexRune", func(b *testing.B) {
b.Run("strings.ContainsRune", func(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
result = false
c := int32(slashDelimiter)
for i := 0; i < b.N; i++ {
result = IndexRune(search, c)
result = strings.ContainsRune(search, c)
}
require.True(b, result)
})
Expand Down

0 comments on commit 7dc7728

Please sign in to comment.