Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

Change some for ... in .. clauses to for ... of ... #230

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions feature_store_event_wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ function NamespacedDataSet() {
for (const ns in itemsByNamespace) {
const items = itemsByNamespace[ns];
const keys = Object.keys(items).sort(); // sort to make tests determinate
for (const i in keys) {
const key = keys[i];
for (const key of keys) {
callback(ns, key, items[key]);
}
}
Expand Down Expand Up @@ -138,16 +137,14 @@ function FeatureStoreEventWrapper(featureStore, emitter) {
function computeDependencies(kind, item) {
const ret = NamespacedDataSet();
if (kind === dataKind.features) {
for (const i in item.prerequisites || []) {
ret.set(dataKind.features.namespace, item.prerequisites[i].key, true);
for (const prerequisite of item.prerequisites || []) {
ret.set(dataKind.features.namespace, prerequisite.key, true);
}
for (const i in item.rules || []) {
const rule = item.rules[i];
for (const j in rule.clauses || []) {
const clause = rule.clauses[j];
for (const rule of item.rules || []) {
for (const clause of rule.clauses || []) {
if (clause.op === 'segmentMatch') {
for (const k in clause.values) {
ret.set(dataKind.segments.namespace, clause.values[k], true);
for (const value of clause.values) {
ret.set(dataKind.segments.namespace, value, true);
}
}
}
Expand Down