MCPcopy Create free account
hub / github.com/alibaba/open-code-review / NewDiffMap

Function NewDiffMap

internal/tool/file_read_diff.go:15–21  ·  view source on GitHub ↗

NewDiffMap creates a frozen, read-only DiffMap from a plain map.

(m map[string]string)

Source from the content-addressed store, hash-verified

13
14// NewDiffMap creates a frozen, read-only DiffMap from a plain map.
15func NewDiffMap(m map[string]string) DiffMap {
16 cp := make(map[string]string, len(m))
17 for k, v := range m {
18 cp[k] = v
19 }
20 return DiffMap{m: cp}
21}
22
23// Get returns the diff text for path.
24func (d DiffMap) Get(path string) (string, bool) {

Callers 8

injectScanContentMapMethod · 0.92
TestInjectDiffMapFunction · 0.92
injectDiffMapMethod · 0.92
TestDiffMap_GetFunction · 0.85

Calls

no outgoing calls

Tested by 6

TestInjectDiffMapFunction · 0.74
TestDiffMap_GetFunction · 0.68