Skip to content

Commit 17ac170

Browse files
few small refactors
1 parent 87a12cd commit 17ac170

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
@@ -4298,18 +4298,14 @@ func (cmd *CommandsInfoCmd) readReply(rd *proto.Reader) error {
42984298
return err
42994299
}
43004300

4301-
// Handle tips that don't have a colon (like "nondeterministic_output")
4302-
if !strings.Contains(tip, ":") {
4303-
rawTips[tip] = ""
4304-
continue
4305-
}
4306-
4307-
// Handle normal key:value tips
43084301
k, v, ok := strings.Cut(tip, ":")
43094302
if !ok {
4310-
return fmt.Errorf("redis: unexpected tip %q in COMMAND reply", tip)
4303+
// Handle tips that don't have a colon (like "nondeterministic_output")
4304+
rawTips[tip] = ""
4305+
} else {
4306+
// Handle normal key:value tips
4307+
rawTips[k] = v
43114308
}
4312-
rawTips[k] = v
43134309
}
43144310
cmdInfo.CommandPolicy = parseCommandPolicies(rawTips)
43154311

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)