Skip to content

Conversation

@dredav
Copy link
Contributor

@dredav dredav commented Mar 2, 2019

Description

Sorting titles with numbers tries to match float values of left and right titles at comparison. When both numbers are floats and not equal we can do a direct compare. In all other cases the full title will compare.

Screenshot before

screen shot 2019-03-02 at 14 22 26

Screenshot after

screen shot 2019-03-02 at 14 22 58

Issue fixed

#2894

Type of changes

  • 🔵 Bug fix (Change that fixed an issue)
  • ⚪ Breaking change (Change that can cause existing functionality to change)
  • ⚪ Improvement (Change that improves the code. Maybe performance or development improvement)
  • ⚪ Feature (Change that adds new functionality)
  • ⚪ Documentation change (Change that modifies documentation. Maybe typo fixes)

Checklist:

  • 🔵 My code follows the project code style
  • ⚪ I have written test for my code and it has been tested
  • 🔵 All existing tests have been passed
  • 🔵 I have attached a screenshot/video to visualize my change if possible

@ZeroX-DG ZeroX-DG added the awaiting review ❇️ Pull request is awaiting a review. label Mar 3, 2019
Copy link
Member

@ZeroX-DG ZeroX-DG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

@ZeroX-DG ZeroX-DG added approved 👍 Pull request has been approved by sufficient reviewers. needs extra review 🔎 Pull request requires review from an additional reviewer. and removed awaiting review ❇️ Pull request is awaiting a review. labels Mar 6, 2019
@Rokt33r Rokt33r added this to the v0.11.15 milestone Mar 20, 2019
const floatA = parseFloat(matchA[1])
const floatB = parseFloat(matchB[1])

if (floatA < floatB) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than using if statement, return floatA - floatB should be enough.

@Rokt33r
Copy link
Member

Rokt33r commented Mar 25, 2019

@dredav I've submitted a change request. I'll merge this as soon as you resolve it.

@Rokt33r Rokt33r added awaiting changes 🖊️ Pull request has been reviewed, but contributor needs to make changes. and removed needs extra review 🔎 Pull request requires review from an additional reviewer. approved 👍 Pull request has been approved by sufficient reviewers. labels Mar 25, 2019
@dredav
Copy link
Contributor Author

dredav commented Mar 25, 2019

@dredav I've submitted a change request. I'll merge this as soon as you resolve it.

Thanks for your review @Rokt33r. I've removed the if / else if to return-1 or 1, but I must add a Math.Abs call to check if the floats are equal or not. For the equal case we need to compare the full note title in case for title example 1.0 Note 2 and 1.0 Note 1.

@dredav
Copy link
Contributor Author

dredav commented Apr 28, 2019

@Rokt33r What do you think?

@dredav I've submitted a change request. I'll merge this as soon as you resolve it.

Thanks for your review @Rokt33r. I've removed the if / else if to return-1 or 1, but I must add a Math.Abs call to check if the floats are equal or not. For the equal case we need to compare the full note title in case for title example 1.0 Note 2 and 1.0 Note 1.

@Rokt33r Rokt33r removed the awaiting changes 🖊️ Pull request has been reviewed, but contributor needs to make changes. label May 8, 2019
Copy link
Member

@Rokt33r Rokt33r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for my late review. How do you think? @dredav

@Rokt33r Rokt33r added the awaiting review ❇️ Pull request is awaiting a review. label May 8, 2019
@Rokt33r Rokt33r merged commit 9a6ee9d into BoostIO:master May 9, 2019
@Rokt33r Rokt33r removed the awaiting review ❇️ Pull request is awaiting a review. label May 9, 2019
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