Skip to content

GODRIVER-3111 Combine the identical if-else branches in bson/primitive/decimal.go #1531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

chengfang
Copy link
Contributor

Summary

In bson/primitive/decimal.go around line 167, the following if-else branches contain the same logic, and should be combined:

if high == 0 && low == 0 && exp == 0 {
  if posSign {
    return new(big.Int), 0, nil
  }
  return new(big.Int), 0, nil

 ## Background & Motivation

Make the code more readable and robust

@chengfang chengfang requested a review from a team as a code owner January 29, 2024 04:03
@chengfang chengfang requested review from qingyang-hu and removed request for a team January 29, 2024 04:03
@qingyang-hu qingyang-hu changed the title Combine the identical if-else branches in bson/primitive/decimal.go GODRIVER-3111 Combine the identical if-else branches in bson/primitive/decimal.go Jan 31, 2024
Copy link
Contributor

API Change Report

No changes found!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants