Skip to content

Commit 7540081

Browse files
committed
docs: update comments from memoization to caching
Signed-off-by: Sinhyeok Seo <[email protected]>
1 parent bbee36f commit 7540081

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

util/glob/glob.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func getOrCompile(pattern string, separators ...rune) (glob.Glob, error) {
5555
}
5656

5757
// Match tries to match a text with a given glob pattern.
58-
// Compiled glob patterns are memoized for performance.
58+
// Compiled glob patterns are cached for performance.
5959
func Match(pattern, text string, separators ...rune) bool {
6060
compiled, err := getOrCompile(pattern, separators...)
6161
if err != nil {
@@ -67,7 +67,7 @@ func Match(pattern, text string, separators ...rune) bool {
6767

6868
// MatchWithError tries to match a text with a given glob pattern.
6969
// Returns error if the glob pattern fails to compile.
70-
// Compiled glob patterns are memoized for performance.
70+
// Compiled glob patterns are cached for performance.
7171
func MatchWithError(pattern, text string, separators ...rune) (bool, error) {
7272
compiled, err := getOrCompile(pattern, separators...)
7373
if err != nil {

util/glob/glob_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ func BenchmarkMatch_RBACSimulation(b *testing.B) {
224224
}
225225
text := "proj:team-25/my-app"
226226

227-
// With memoization: patterns are compiled once
227+
// With caching: patterns are compiled once
228228
b.ResetTimer()
229229
for i := 0; i < b.N; i++ {
230230
for _, pattern := range patterns {

0 commit comments

Comments
 (0)