« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/wiki-data.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/util/wiki-data.js b/src/util/wiki-data.js
index 7d2cfa9f..f044b2a1 100644
--- a/src/util/wiki-data.js
+++ b/src/util/wiki-data.js
@@ -1,6 +1,9 @@
 // Utility functions for interacting with wiki data.
 
-import {empty} from './sugar.js';
+import {
+  accumulateSum,
+  empty,
+} from './sugar.js';
 
 // Generic value operations
 
@@ -382,7 +385,7 @@ export function getFlashLink(flash) {
 }
 
 export function getTotalDuration(tracks) {
-  return tracks.reduce((duration, track) => duration + track.duration, 0);
+  return accumulateSum(tracks, track => track.duration);
 }
 
 export function getTrackCover(track, {to}) {