summaryrefslogtreecommitdiff
path: root/src/marker.c
diff options
context:
space:
mode:
authorDmitry Antipov <dmantipov@yandex.ru>2012-07-05 20:14:39 +0400
committerDmitry Antipov <dmantipov@yandex.ru>2012-07-05 20:14:39 +0400
commit6b312f0fec9becd1ce97f55d5707e79586f954eb (patch)
treee8c4d97a3512b3efec0b3257435c56de3b66cd60 /src/marker.c
parentf520ef9bc1f5d7b88b401c8784ac29457a0ef43c (diff)
downloademacs-6b312f0fec9becd1ce97f55d5707e79586f954eb.tar.gz
emacs-6b312f0fec9becd1ce97f55d5707e79586f954eb.tar.bz2
emacs-6b312f0fec9becd1ce97f55d5707e79586f954eb.zip
* marker.c (set_marker_restricted_both): Simplify by using
clip_to_bounds.
Diffstat (limited to 'src/marker.c')
-rw-r--r--src/marker.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/marker.c b/src/marker.c
index 2c09b8e19a2..a059987aa51 100644
--- a/src/marker.c
+++ b/src/marker.c
@@ -667,14 +667,8 @@ set_marker_restricted_both (Lisp_Object marker, Lisp_Object buffer, ptrdiff_t ch
}
}
- if (charpos < BUF_BEGV (b))
- charpos = BUF_BEGV (b);
- if (charpos > BUF_ZV (b))
- charpos = BUF_ZV (b);
- if (bytepos < BUF_BEGV_BYTE (b))
- bytepos = BUF_BEGV_BYTE (b);
- if (bytepos > BUF_ZV_BYTE (b))
- bytepos = BUF_ZV_BYTE (b);
+ charpos = clip_to_bounds (BUF_BEGV (b), charpos, BUF_ZV (b));
+ bytepos = clip_to_bounds (BUF_BEGV_BYTE (b), bytepos, BUF_ZV_BYTE (b));
/* In a single-byte buffer, the two positions must be equal. */
if (BUF_Z (b) == BUF_Z_BYTE (b)