4 ms·
You can certainly sort a string, but I think there are valid reasons to avoid it if possible. What they shouldn't be doing is trying to shove it into a single 3
by DSMan195276 5y ago
You can certainly sort a string, but I think there are valid reasons to avoid it if possible. What they shouldn't be doing is trying to shove it into a single 32-bit integer - if they parsed it into separate integers for each of the individual parts (like a simple date representation would do) then the issue would go away. Whether it's worth that extra work to avoid the string comparison is debatable, but if they go on to mask out parts of the version number and look at them individually (Ex. Only the year, or only the revision number) than it would probably be worth it to just do all the parsing upfront and avoid any messing with strings after that.