From 2591818c5f7fec5c14794282fcc0677a8511424f Mon Sep 17 00:00:00 2001 From: Ilija Puaca Date: Thu, 15 Apr 2021 17:13:03 +0200 Subject: [PATCH] Statically require implementations --- loader.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/loader.js b/loader.js index a983814..b047454 100644 --- a/loader.js +++ b/loader.js @@ -1,11 +1,10 @@ +const sse4_crc32c = require('./impls/sse4_crc32c'); +const js_crc32c = require('./impls/js_crc32c'); + module.exports = (function() { - const impls = [ - './impls/sse4_crc32c', - './impls/js_crc32c', - ]; - for (const impl of impls) { + const impls = [sse4_crc32c, js_crc32c]; + for (const crc32 of impls) { try { - const crc32 = require(impl); if (crc32.calculate('The quick brown fox jumps over the lazy dog') === 0x22620404) { return crc32; }