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

Function NewDiffMap

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

24
25// NewDiffMap creates a frozen, read-only DiffMap from a plain map.
26func NewDiffMap(m map[string]string) DiffMap {
27 cp := make(map[string]string, len(m))
28 maps.Copy(cp, m)
29 return DiffMap{m: cp}
30}
31
32// Get returns the diff text for path.
33func (d DiffMap) Get(path string) (string, bool) {

Calls

no outgoing calls