decord/source/1155_mergeOutcomes.js

30 lines
837 B
JavaScript
Raw Normal View History

2026-07-20 16:05:17 +00:00
// Module ID: 1155
2026-07-25 08:10:48 +00:00
// Function ID: 13147
2026-07-20 16:05:17 +00:00
// Name: mergeOutcomes
2026-07-23 10:11:24 +00:00
// Dependencies: [65]
2026-07-20 16:05:17 +00:00
// Exports: mergeOutcomes
// Module 1155 (mergeOutcomes)
2026-07-23 10:11:24 +00:00
import _toConsumableArray from "_toConsumableArray";
2026-07-20 16:05:17 +00:00
export const mergeOutcomes = function mergeOutcomes(_outcomesBuffer, _clearOutcomesResult) {
const map = new Map();
function process(reason) {
const combined = "" + reason.reason + ":" + reason.category;
const value = map.get(combined);
if (value) {
value.quantity = value.quantity + reason.quantity;
} else {
const result = map.set(combined, reason);
}
}
const length = arguments.length;
const arr = new Array(length);
for (let num = 0; num < length; num = num + 1) {
arr[num] = arguments[num];
}
const item = arr.forEach((arr) => arr.forEach(process));
2026-07-23 10:11:24 +00:00
return map(map.values());
2026-07-20 16:05:17 +00:00
};