Skip to content

Commit 76c470f

Browse files
committed
fix(address_search_using_ids): fix unbounded memory growth
1 parent 62cd3fe commit 76c470f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

query/address_search_using_ids.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,12 @@ function generateQuery( clean, res ){
129129
vs.var( 'input:street', clean.parsed_text.street );
130130

131131
// find the first granularity band for which there are results
132-
const granularity_band = granularity_bands.find(band => anyResultsAtGranularityBand(results, band));
132+
let granularity_band = granularity_bands.find(band => anyResultsAtGranularityBand(results, band));
133133

134134
// special case: if locality is present in the band, also include macrocounty
135135
// this is used to cover the Greater Syndey Area
136136
if (granularity_band && granularity_band.includes('locality')) {
137-
granularity_band.push('macrocounty');
137+
granularity_band = [...granularity_band, 'macrocounty'];
138138
}
139139

140140
// if there's a granularity band, accumulate the ids from each layer in the band

0 commit comments

Comments
 (0)