videojs / http-streaming

HLS, DASH, and future HTTP streaming protocols library for video.js
https://videojs-http-streaming.netlify.app/
Other
2.45k stars 419 forks source link

refactor: remove nested loop from removeDuplicateCuesFromTrack function #1381

Closed alex-barstow closed 1 year ago

alex-barstow commented 1 year ago

Description

The removeDuplicateCuesFromTrack() function was poorly optimized. The nested loop would run a staggering number of times in cases of very large VTT files. This change accomplishes duplicate cue removal with a single loop.

codecov[bot] commented 1 year ago

Codecov Report

Merging #1381 (957d84c) into main (93a2bfd) will decrease coverage by 0.01%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1381      +/-   ##
==========================================
- Coverage   85.36%   85.35%   -0.01%     
==========================================
  Files          40       40              
  Lines        9957     9951       -6     
  Branches     2311     2306       -5     
==========================================
- Hits         8500     8494       -6     
  Misses       1457     1457              
Impacted Files Coverage Δ
src/util/text-tracks.js 86.27% <100.00%> (-0.77%) :arrow_down:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more