Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions internal/approval/glob_test_helpers_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package approval

import "regexp"

func globCacheLen() int {
globCache.RLock()
n := len(globCache.m)
globCache.RUnlock()
return n
}

func resetGlobCache() {
globCache.Lock()
globCache.m = make(map[string]*regexp.Regexp)
globCache.Unlock()
}
15 changes: 0 additions & 15 deletions internal/approval/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,21 +499,6 @@ func globToRegexp(pattern string) (*regexp.Regexp, error) {
return re, nil
}

// globCacheLen returns the current number of entries in the glob regexp cache.
// Exported for testing only.
func globCacheLen() int {
globCache.RLock()
n := len(globCache.m)
globCache.RUnlock()
return n
}

// resetGlobCache clears the glob regexp cache. Exported for testing only.
func resetGlobCache() {
globCache.Lock()
globCache.m = make(map[string]*regexp.Regexp)
globCache.Unlock()
}

// judgeResultToLLMResponse converts a JudgeResult to a types.LLMResponse.
func judgeResultToLLMResponse(r judge.JudgeResult, err error) *types.LLMResponse {
Expand Down
Loading