Skip to content

Commit

Permalink
Update htmx.py
Browse files Browse the repository at this point in the history
changed list function to next function to achieve an optimal performance
  • Loading branch information
claudiomansillab authored Oct 22, 2024
1 parent 8c83ae8 commit b71c1a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lightcurve/src/crossmatch_api/routes/htmx.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ async def object_mag_app(

cross_keys_raw = []
for i in range(len(cross)):
cross_keys_raw.append(list(cross[i].keys())[0])
cross_keys_raw.append(next(iter(cross[i].keys())))

cross_keys = []
for i in range(len(cross)):
if list(cross[i].values())[0]['distance']['value'] <= 20:
cross_keys.append(list(cross[i].keys())[0])
if next(iter(cross[i].values()))['distance']['value'] <= 20:
cross_keys.append(next(iter(cross[i].keys())))

return templates.TemplateResponse(
name='crossmatch.html.jinja',
Expand Down

0 comments on commit b71c1a5

Please sign in to comment.