File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -70,10 +70,14 @@ def get_next_version_component(s):
7070 yield LibversionVersion .parse_token_to_component (component )
7171
7272 def compare_components (self , other ):
73- min_len = min (len (self .components ), len (other .components ))
74- for i in range (min_len ):
75- c1 = self .components [i ]
76- c2 = other .components [i ]
73+ max_len = max (len (self .components ), len (other .components ))
74+
75+ for i in range (max_len ):
76+ """
77+ Get current components or pad with zero
78+ """
79+ c1 = self .components [i ] if i < len (self .components ) else ("0" , METAORDER_ZERO )
80+ c2 = other .components [i ] if i < len (other .components ) else ("0" , METAORDER_ZERO )
7781
7882 """
7983 Compare based on metaorder
@@ -123,12 +127,4 @@ def compare_components(self, other):
123127 elif c1_value > c2_value :
124128 return 1
125129
126- """
127- Components are equal; check for length of components
128- """
129- if len (self .components ) < len (other .components ):
130- return - 1
131- elif len (self .components ) > len (other .components ):
132- return 1
133- else :
134- return 0
130+ return 0
You can’t perform that action at this time.
0 commit comments