forked from unknwon/the-way-to-go_ZH_CN
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update min_interface.go (unknwon#543)
Min(data Miner) 方法存在bug,原因是: 该方法的逻辑类似冒泡排序, 将Miner类型变量的集合挨个两两比对,但方法中仅将两变量的较小值取出(Less()方法),并赋值记录为min,最后返回,并没有进行“冒泡”这个swap操作。 因此补充了Swap()相关的接口和实现定义,并补充了Swap()在Min()方法中的逻辑。
- Loading branch information
Showing
1 changed file
with
9 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters