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

Function NewDiffMap

internal/tool/file_read_diff.go:18–24  ·  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

16
17// NewDiffMap creates a frozen, read-only DiffMap from a plain map.
18func NewDiffMap(m map[string]string) DiffMap {
19 cp := make(map[string]string, len(m))
20 for k, v := range m {
21 cp[k] = v
22 }
23 return DiffMap{m: cp}
24}
25
26// Get returns the diff text for path.
27func (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