Skip to content

Commit fe3b85f

Browse files
committed
Prefer builtin ListToWaveRefWave instead of our own ConvertListOfWaves
ListToWaveRefWave is present since IP7. We don't set bit 0 of the options parameter of ListToWaveRefWave which generates an error if the list entry does not point to a valid wave as none of the callers require that feature.
1 parent 39bb35a commit fe3b85f

File tree

2 files changed

+2
-21
lines changed

2 files changed

+2
-21
lines changed

Packages/MIES/MIES_MiesUtilities.ipf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5122,7 +5122,7 @@ Function RemoveTracesFromGraph(graph, [kill, trace, wv, dfr])
51225122
endif
51235123

51245124
if(!ParamIsDefault(dfr))
5125-
WAVE candidates = ConvertListOfWaves(GetListOfObjects(dfr, ".*", fullpath=1))
5125+
WAVE/WAVE candidates = ListToWaveRefWave(GetListOfObjects(dfr, ".*", fullpath=1))
51265126
endif
51275127

51285128
remove_all_traces = ParamIsDefault(trace) && ParamIsDefault(wv) && ParamIsDefault(dfr)

Packages/MIES/MIES_Utilities.ipf

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,7 +1319,7 @@ Function IsWaveDisplayedOnGraph(win, [wv, dfr])
13191319
return 0
13201320
endif
13211321

1322-
WAVE candidates = ConvertListOfWaves(GetListOfObjects(dfr, ".*", fullpath=1))
1322+
WAVE/WAVE candidates = ListToWaveRefWave(GetListOfObjects(dfr, ".*", fullpath=1))
13231323
numWaves = DimSize(candidates, ROWS)
13241324
endif
13251325

@@ -1867,25 +1867,6 @@ threadsafe Function GetRowIndex(wv, [val, str, refWave])
18671867
return NaN
18681868
End
18691869

1870-
/// @brief Converts a list of strings referencing waves with full paths to a wave of wave references
1871-
///
1872-
/// It is assumed that all created wave references refer to an *existing* wave
1873-
Function/WAVE ConvertListOfWaves(list)
1874-
string list
1875-
1876-
variable i, numEntries
1877-
numEntries = ItemsInList(list)
1878-
MAKE/FREE/WAVE/N=(numEntries) waves
1879-
1880-
for(i = 0; i < numEntries; i += 1)
1881-
WAVE/Z wv = $StringFromList(i, list)
1882-
ASSERT(WaveExists(wv), "The wave does not exist")
1883-
waves[i] = wv
1884-
endfor
1885-
1886-
return waves
1887-
End
1888-
18891870
/// @brief return a subset of the input list
18901871
///
18911872
/// @param list input list

0 commit comments

Comments
 (0)