about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-07-03 00:43:09 +0000
committerEric Wong <e@80x24.org>2023-07-03 02:06:54 +0000
commit93588fe62d15f067dd77f0d7a3f549a4c9e0b89a (patch)
tree013576d9dc171e45121702471ea1374d29fdaf74
parent25f05d318b48d235ae9886e29ce1ff677fb3d36f (diff)
downloaddtas-93588fe62d15f067dd77f0d7a3f549a4c9e0b89a.tar.gz
Syscalls and waiting for responses are expensive, so grab 128
track IDs at once like we do for other subcommands.
-rwxr-xr-xbin/dtas-tl8
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/dtas-tl b/bin/dtas-tl
index 7659570..45a18b5 100755
--- a/bin/dtas-tl
+++ b/bin/dtas-tl
@@ -175,10 +175,10 @@ when "reto"
   time = ARGV[2]
   re = Regexp.quote(re) if fixed
   re = ignorecase ? %r{#{re}}i : %r{#{re}}
-  get_track_ids(c).each do |track_id|
-    res = c.req("tl get #{track_id}")
-    res.sub!(/\A1 \d+=/, '')
-    if re =~ res
+  each_track(c) do |line|
+    line.sub!(/\A(\d+)=/, '')
+    track_id = $1
+    if re =~ line
       req = %W(tl goto #{track_id})
       req << time if time
       res = c.req(req)