MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / operator<

Method operator<

launcher/Version.cpp:13–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11}
12
13bool Version::operator<(const Version &other) const
14{
15 const int size = qMax(m_sections.size(), other.m_sections.size());
16 for (int i = 0; i < size; ++i)
17 {
18 const Section sec1 = (i >= m_sections.size()) ? Section("0") : m_sections.at(i);
19 const Section sec2 =
20 (i >= other.m_sections.size()) ? Section("0") : other.m_sections.at(i);
21 if (sec1 != sec2)
22 {
23 return sec1 < sec2;
24 }
25 }
26
27 return false;
28}
29bool Version::operator<=(const Version &other) const
30{
31 return *this < other || *this == other;

Callers

nothing calls this directly

Calls 3

SectionClass · 0.85
sizeMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected