Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

fix: GCDSlice returns 1 when slice is empty #1302

Merged
merged 1 commit into from
Apr 28, 2020

Conversation

lowzj
Copy link
Member

@lowzj lowzj commented Apr 26, 2020

Signed-off-by: lowzj [email protected]

Ⅰ. Describe what this PR did

The GCDSlice does not consider the situation when the giving slice is nil or empty.
This pr makes it returns 1 when s is empty because that any number divided by 1 is still
itself.

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@pouchrobot pouchrobot added kind/bug This is bug report for project size/XS labels Apr 26, 2020
@codecov-io
Copy link

codecov-io commented Apr 26, 2020

Codecov Report

Merging #1302 into master will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1302      +/-   ##
==========================================
+ Coverage   51.21%   51.22%   +0.01%     
==========================================
  Files         124      124              
  Lines        8152     8154       +2     
==========================================
+ Hits         4175     4177       +2     
  Misses       3639     3639              
  Partials      338      338              
Impacted Files Coverage Δ
dfget/config/supernode_value.go 72.64% <100.00%> (ø)
pkg/algorithm/algorithm.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a8ade02...10cfda1. Read the comment docs.

@starnop
Copy link
Contributor

starnop commented Apr 28, 2020

LGTM.

@starnop starnop merged commit ca96df3 into dragonflyoss:master Apr 28, 2020
@lowzj lowzj deleted the fix-GCDSlice branch April 28, 2020 03:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug This is bug report for project size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants