From 6d6d9cd607601f41501b8f64230150ae26b8d500 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 12 Sep 2016 08:18:15 -0700 Subject: * src/casefiddle.c (casify_word): Simplify. --- src/casefiddle.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/src/casefiddle.c b/src/casefiddle.c index 59b5bbcf43..2d32f498d0 100644 --- a/src/casefiddle.c +++ b/src/casefiddle.c @@ -378,24 +378,12 @@ character positions to operate on. */) static Lisp_Object casify_word (enum case_action flag, Lisp_Object arg) { - Lisp_Object beg, end; - ptrdiff_t newpoint; - EMACS_INT iarg; - CHECK_NUMBER (arg); - iarg = XINT (arg); - - newpoint = scan_words (PT, iarg); - if (!newpoint) - newpoint = iarg > 0 ? ZV : BEGV; - - XSETFASTINT (beg, PT); - XSETFASTINT (end, newpoint); - if (PT > newpoint) - newpoint = PT; - - casify_region (flag, beg, end); - + ptrdiff_t farend = scan_words (PT, XINT (arg)); + if (!farend) + farend = XINT (arg) <= 0 ? BEGV : ZV; + ptrdiff_t newpoint = max (PT, farend); + casify_region (flag, make_number (PT), make_number (farend)); SET_PT (newpoint); return Qnil; } -- cgit v1.2.3