aboutsummaryrefslogtreecommitdiff
path: root/text-util.c
diff options
context:
space:
mode:
authorRandy Palamar <randy@rnpnr.xyz>2025-11-23 20:36:44 -0700
committerRandy Palamar <randy@rnpnr.xyz>2025-11-24 05:25:54 -0700
commit065b905fe05283820bb68d56c4057bd2c8484fc1 (patch)
treed7886584042140b693c9fa2e8af739e0741ebe29 /text-util.c
parent5df02c199959b9da42baff0c876bf87125178ca0 (diff)
downloadvis-065b905fe05283820bb68d56c4057bd2c8484fc1.tar.gz
vis-065b905fe05283820bb68d56c4057bd2c8484fc1.tar.xz
text-util: convert trivial functions to macros
This would be less of an issue if vis was compiled as a single translation unit but even then compiler may not inline them if they are not marked as static.
Diffstat (limited to 'text-util.c')
-rw-r--r--text-util.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/text-util.c b/text-util.c
index 3cc994e..7e47cce 100644
--- a/text-util.c
+++ b/text-util.c
@@ -4,18 +4,6 @@
#include <errno.h>
#include <stdlib.h>
-bool text_range_valid(const Filerange *r) {
- return r->start != EPOS && r->end != EPOS && r->start <= r->end;
-}
-
-size_t text_range_size(const Filerange *r) {
- return text_range_valid(r) ? r->end - r->start : 0;
-}
-
-Filerange text_range_empty(void) {
- return (Filerange){ .start = EPOS, .end = EPOS };
-}
-
Filerange text_range_union(const Filerange *r1, const Filerange *r2) {
if (!text_range_valid(r1))
return *r2;