@woosh/meep-engine 2.113.4 → 2.113.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/meep.cjs CHANGED
@@ -50929,16 +50929,21 @@ function computeStringHash(string) {
50929
50929
 
50930
50930
  const length = string.length;
50931
50931
 
50932
- let hash = 0;
50932
+ let hash = length;
50933
50933
 
50934
50934
  for (let i = 0; i < length; i++) {
50935
- const charCode = string.charCodeAt(i);
50935
+ const code_point = string.charCodeAt(i);
50936
50936
 
50937
- hash = (31 * hash + charCode) | 0;
50937
+ /*
50938
+ * Avoiding potentially expensive multiplication operation by using 2 cheaper operation instead
50939
+ * (h<<5) - h === h*31
50940
+ */
50941
+ hash = ((hash << 5) - hash) + code_point;
50938
50942
 
50939
50943
  }
50940
50944
 
50941
- return hash;
50945
+ // force uint32
50946
+ return hash >>> 0;
50942
50947
  }
50943
50948
 
50944
50949
  /**
@@ -59812,9 +59817,9 @@ function array_swap_one(array, index0, index1) {
59812
59817
  }
59813
59818
 
59814
59819
  /**
59815
- *
59820
+ * @example `const my_array = new ( UintArrayForCount(x) )(length);`
59816
59821
  * @param {number} max_value maximum value to be contained in the array
59817
- * @returns {function} constructor
59822
+ * @returns {function} TypedArray constructor
59818
59823
  */
59819
59824
  function UintArrayForCount(max_value) {
59820
59825