ax(node): rename idx to separatorIndex in parseComment
AX Principle 1 — predictable names over short names. idx is an abbreviation requiring a mental mapping; separatorIndex names the variable by its role (the index of the = separator character). Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
38b22f96a0
commit
857c5f0ae3
1 changed files with 3 additions and 3 deletions
|
|
@ -144,9 +144,9 @@ func DiscoverGateways(daemonURL string) []PoolGateway {
|
|||
func parseComment(comment string) map[string]string {
|
||||
result := make(map[string]string)
|
||||
for _, part := range strings.Split(comment, ";") {
|
||||
idx := strings.IndexByte(part, '=')
|
||||
if idx > 0 {
|
||||
result[part[:idx]] = part[idx+1:]
|
||||
separatorIndex := strings.IndexByte(part, '=')
|
||||
if separatorIndex > 0 {
|
||||
result[part[:separatorIndex]] = part[separatorIndex+1:]
|
||||
}
|
||||
}
|
||||
return result
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue