|
|
|
|
|
by techjamie
767 days ago
|
|
Maybe the sheer amount that strings are getting iterated through makes storing length computationally cheaper? Unless you're using very optimized methods to work with the string, the majority of string operations involve a lot of iteration and comparison. Vectors, on the other hand, have much more varied use and possibly may never be iterated at all (though they likely will somewhere). |
|
So for loop conditions like
are cheaper to calculate?