About ordering (seems that's becoming my speciality :))
See original GitHub issueSince it is not strictly a bug, I’m opening an issue here. The semver specification explicitly states that:
“Build metadata SHOULD be ignored when determining version precedence. Thus two versions that differ only in the build metadata, have the same precedence. Examples: 1.0.0-alpha+001, 1.0.0+20130313144700, 1.0.0-beta+exp.sha.5114f85.”
However, the Build metadata is actually considered in CompareTo method:
public int CompareTo(SemVersion other)
{
if (ReferenceEquals(other, null))
return 1;
var r = this.CompareByPrecedence(other);
if (r != 0)
return r;
r = CompareComponent(this.Build, other.Build);
return r;
}
Up to me, it should only be:
public int CompareTo(SemVersion other)
{
if (ReferenceEquals(other, null))
return 1;
return CompareByPrecedence(other);
}
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
How retailers can keep up with consumers
When a customer orders a pair of shoes online at full price, the system looks across the network for the store that has...
Read more >Check Your Prescription Status
Conveniently check your prescription status online by tracking your order and receiving Rx status text alerts with CVS Specialty pharmacy.
Read more >14 Different Types of Surgeons and Surgical Specialities
Considering becoming a surgeon? St. George's Medical School reviews 14 types of surgeons and different surgical specialties you could ...
Read more >Protective Orders | Bexar County, TX - Official Website
Orders that the person you filed against not commit any of the above acts towards you or your household members. Who can you...
Read more >Pricing and Insurance | DUPIXENT® (dupilumab)
Find information on insurance coverage, ordering through a specialty pharmacy, and the cost of DUPIXENT® (dupilumab), a prescription medicine FDA-approved ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That’s exactly my point: semantically, the Build does not participate at all (It is a “decoration”): I would ignore it in CompareTo as well as in Equal (and document this of course).
In v2.2.0, the
CompareTo
method has been marked[Obsolete]
. It has been replaced by aCompareSortOrderTo
andComparePrecedenceTo
method so that it will always be clear how the versions are being compared.