summaryrefslogtreecommitdiff
path: root/src/tg/message-entity.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tg/message-entity.lisp')
-rw-r--r--src/tg/message-entity.lisp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tg/message-entity.lisp b/src/tg/message-entity.lisp
index 3413763..c7e6ba1 100644
--- a/src/tg/message-entity.lisp
+++ b/src/tg/message-entity.lisp
@@ -37,7 +37,7 @@
37 37
38(defun message-entity-extract (entity text) 38(defun message-entity-extract (entity text)
39 (with-slots (length offset) entity 39 (with-slots (length offset) entity
40 (if (= length 0) 40 (if (zerop length)
41 "" 41 ""
42 (let* ((start (iterate 42 (let* ((start (iterate
43 (with curr-idx16 = 0) 43 (with curr-idx16 = 0)
@@ -46,7 +46,7 @@
46 (when (or (= curr-idx16 offset) 46 (when (or (= curr-idx16 offset)
47 (> (+ curr-idx16 curr-width) offset)) 47 (> (+ curr-idx16 curr-width) offset))
48 (return curr-idx32)) 48 (return curr-idx32))
49 (setq curr-idx16 (+ curr-idx16 curr-width)) 49 (incf curr-idx16 curr-width)
50 (finally (return (length text))))) 50 (finally (return (length text)))))
51 (end (iterate 51 (end (iterate
52 (with curr-len16 = 0) 52 (with curr-len16 = 0)
@@ -54,6 +54,6 @@
54 (for curr-width = (utf16-width ch)) 54 (for curr-width = (utf16-width ch))
55 (when (>= curr-len16 length) 55 (when (>= curr-len16 length)
56 (return curr-idx32)) 56 (return curr-idx32))
57 (setq curr-len16 (+ curr-len16 curr-width)) 57 (incf curr-len16 curr-width)
58 (finally (return (length text)))))) 58 (finally (return (length text))))))
59 (subseq text start end))))) 59 (subseq text start end)))))