Obsolete continuation of inner loop in ApproximateBestSubset #7182

issue Xekyo opened this issue on December 7, 2015
  1. Xekyo commented at 5:02 PM on December 7, 2015: member

    vValue is sorted into ascending order before ApproximateBestSubset(...) is called.

    Currently, after a new best set is found, the final element that was added gets removed from the set, and the inner loop continues to search through the remainder of vValue for a better set. It is however impossible for a better set to be achieved with a later element in vValue: As vValue is sorted in ascending order, any set formed with a later element will be of same size or bigger.

    Therefore, the lines 1628 & 1629 are obsolete, and the inner loop should also stop on fReachedTarget.

  2. Xekyo commented at 5:37 PM on December 7, 2015: member

    I have created a pull request here: #7183

  3. MarcoFalke commented at 9:57 AM on December 8, 2015: member

    @Xekyo I think you can close this issue, as the PR now covers the details.

  4. laanwj commented at 2:40 PM on December 8, 2015: member

    Agree, this is covered by the PR

  5. laanwj closed this on Dec 8, 2015

  6. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-20 12:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me