Add tests for parseDurationString()#338
Add tests for parseDurationString()#338TobiGr merged 1 commit intoTeamNewPipe:devfrom wb9688:parse-duration-string-test
Conversation
|
@TobiGr: My personal reason would be that the function that calls it returns a long anyway, plus the speed difference is pretty much negligible I think. |
|
@TobiGr @wb9688 think of 32bit arm entry level phones. Long arithmetics should be avoided if not needed. 100 negligible optimizations could make a feelable difference. :) My PR did also change the return type. |
|
@Redirion: I meant e.g. https://github.com/TeamNewPipe/NewPipeExtractor/blob/dev/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamInfoItemExtractor.java#L102 and all the other functions calling it. |
|
Long arithmetics on a 32bit cpu require more ressources and operations. Storing and reading it as long should not be an issue. |
I added some tests for
parseDurationString()and found out that apparently the days behavior was already broken, however YouTube doesn't seem to use days anymore.