Skip to content

Commit 1f0f397

Browse files
committed
SFH_OperationLabnotebookExpandKeys: Prefer FindIndizes
This avoids having to copy, clean and duplicate all the labnotebook keys for each search key.
1 parent 5bbd893 commit 1f0f397

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

Packages/MIES/MIES_SweepFormula.ipf

+6-7
Original file line numberDiff line numberDiff line change
@@ -6245,18 +6245,17 @@ static Function/WAVE SFH_OperationLabnotebookExpandKeys(string graph, WAVE/T LBN
62456245
endif
62466246

62476247
for(j = 0; j < numKeys; j += 1)
6248-
Duplicate/FREE/T entries, filteredEntries
6249-
62506248
key = LBNKeys[j]
6251-
MultiThread filteredEntries = SelectString(stringmatch(entries[p], key), "", entries[p])
6252-
6253-
RemoveTextWaveEntry1D(filteredEntries, "", all = 1)
6249+
WAVE/Z indizes = FindIndizes(entries, str = key, prop = PROP_WILDCARD)
62546250

6255-
Concatenate/NP=(ROWS)/T/FREE {filteredEntries}, allLBNKeys
6251+
if(WaveExists(indizes))
6252+
Make/FREE/N=(DimSize(indizes, ROWS))/T matches = entries[indizes[p]]
6253+
Concatenate/NP=(ROWS)/T/FREE {matches}, allLBNKeys
6254+
endif
62566255
endfor
62576256
endfor
62586257

6259-
if(DimSize(allLBNKeys, ROWS) == 0)
6258+
if(!WaveExists(allLBNKeys))
62606259
return $""
62616260
endif
62626261

0 commit comments

Comments
 (0)