@rotorsoft/act 1.14.0 → 1.14.1

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/dist/index.cjs CHANGED
@@ -1944,8 +1944,17 @@ async function scan_stream_heads(streams) {
1944
1944
  async function partition_by_safety(stream_info, reactive_events_size, skipped) {
1945
1945
  if (reactive_events_size === 0) return [...stream_info.keys()];
1946
1946
  const pending_set = /* @__PURE__ */ new Set();
1947
+ const source_regex = /* @__PURE__ */ new Map();
1948
+ const get_regex = (source) => {
1949
+ let re = source_regex.get(source);
1950
+ if (!re) {
1951
+ re = new RegExp(source);
1952
+ source_regex.set(source, re);
1953
+ }
1954
+ return re;
1955
+ };
1947
1956
  await store2().query_streams((position) => {
1948
- const source_re = position.source ? RegExp(position.source) : void 0;
1957
+ const source_re = position.source ? get_regex(position.source) : void 0;
1949
1958
  for (const [stream, info] of stream_info) {
1950
1959
  if ((!source_re || source_re.test(stream)) && position.at < info.max_id) {
1951
1960
  pending_set.add(stream);