Minor refactor in open_symbol_search
parent
ea6126d310
commit
266ecf6206
|
@ -276,7 +276,16 @@ async def open_symbol_search(
|
||||||
|
|
||||||
async with ctx.open_stream() as stream:
|
async with ctx.open_stream() as stream:
|
||||||
|
|
||||||
|
pattern: str
|
||||||
async for pattern in stream:
|
async for pattern in stream:
|
||||||
# repack in dict form
|
# NOTE: pattern fuzzy-matching is done within
|
||||||
await stream.send(
|
# the methd impl.
|
||||||
await client.search_symbols(pattern))
|
pairs: dict[str, Pair] = await client.search_symbols(
|
||||||
|
pattern,
|
||||||
|
)
|
||||||
|
# repack in fqme-keyed table
|
||||||
|
byfqme: dict[str, Pair] = {}
|
||||||
|
for pair in pairs.values():
|
||||||
|
byfqme[pair.bs_fqme] = pair
|
||||||
|
|
||||||
|
await stream.send(byfqme)
|
||||||
|
|
Loading…
Reference in New Issue