mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
simplify various code using new map index rule
R=r CC=golang-dev https://golang.org/cl/833044
This commit is contained in:
parent
6962e2b754
commit
c7122a3c58
27 changed files with 96 additions and 194 deletions
|
|
@ -62,20 +62,20 @@ func main() {
|
|||
// Make sure we won't be editing files with local pending changes.
|
||||
dirtylist, err := hgModified()
|
||||
chk(err)
|
||||
dirty := make(map[string]int)
|
||||
dirty := make(map[string]bool)
|
||||
for _, f := range dirtylist {
|
||||
dirty[f] = 1
|
||||
dirty[f] = true
|
||||
}
|
||||
conflict := make(map[string]int)
|
||||
conflict := make(map[string]bool)
|
||||
for _, f := range pset.File {
|
||||
if f.Verb == patch.Delete || f.Verb == patch.Rename {
|
||||
if _, ok := dirty[f.Src]; ok {
|
||||
conflict[f.Src] = 1
|
||||
if dirty[f.Src] {
|
||||
conflict[f.Src] = true
|
||||
}
|
||||
}
|
||||
if f.Verb != patch.Delete {
|
||||
if _, ok := dirty[f.Dst]; ok {
|
||||
conflict[f.Dst] = 1
|
||||
if dirty[f.Dst] {
|
||||
conflict[f.Dst] = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue