Skip to content

Commit

Permalink
Simplify mergeRawQueries logic
Browse files Browse the repository at this point in the history
Co-authored-by: Bob Broderick <118225939+bbroder-algo@users.noreply.github.com>
  • Loading branch information
ahangsu and bbroder-algo authored Apr 5, 2023
1 parent 85f115e commit 45d5225
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions daemon/algod/api/client/restClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,10 @@ type RawResponse interface {

// mergeRawQueries merges two raw queries, appending an "&" if both are non-empty
func mergeRawQueries(q1, q2 string) string {
if q1 == "" {
return q2
}
if q2 == "" {
return q1
}
return q1 + "&" + q2
if q1 == "" || q2 == "" {
return q1 + q2
}
return q1 + "&" + q2
}

// submitForm is a helper used for submitting (ex.) GETs and POSTs to the server
Expand Down

0 comments on commit 45d5225

Please sign in to comment.