Skip to content

Commit caa37d3

Browse files
few small refactors
1 parent 593812b commit caa37d3

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

command.go

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4369,18 +4369,14 @@ func (cmd *CommandsInfoCmd) readReply(rd *proto.Reader) error {
43694369
return err
43704370
}
43714371

4372-
// Handle tips that don't have a colon (like "nondeterministic_output")
4373-
if !strings.Contains(tip, ":") {
4374-
rawTips[tip] = ""
4375-
continue
4376-
}
4377-
4378-
// Handle normal key:value tips
43794372
k, v, ok := strings.Cut(tip, ":")
43804373
if !ok {
4381-
return fmt.Errorf("redis: unexpected tip %q in COMMAND reply", tip)
4374+
// Handle tips that don't have a colon (like "nondeterministic_output")
4375+
rawTips[tip] = ""
4376+
} else {
4377+
// Handle normal key:value tips
4378+
rawTips[k] = v
43824379
}
4383-
rawTips[k] = v
43844380
}
43854381
cmdInfo.CommandPolicy = parseCommandPolicies(rawTips)
43864382

internal/routing/aggregator.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ func (a *AggLogicalAndAggregator) Add(result interface{}, err error) error {
477477
val, e := toBool(result)
478478
if e != nil {
479479
a.err.CompareAndSwap(nil, e)
480-
return nil
480+
return e
481481
}
482482

483483
if val {
@@ -561,7 +561,7 @@ func (a *AggLogicalOrAggregator) Add(result interface{}, err error) error {
561561
val, e := toBool(result)
562562
if e != nil {
563563
a.err.CompareAndSwap(nil, e)
564-
return nil
564+
return e
565565
}
566566

567567
if val {

0 commit comments

Comments
 (0)