GNU bug report logs -
#25243
26.0.50; ffap-guesser very slow w/ region active in large diff files
Previous Next
Reported by: Tino Calancha <tino.calancha <at> gmail.com>
Date: Wed, 21 Dec 2016 15:37:02 UTC
Severity: minor
Tags: patch
Found in version 26.0.50
Done: Tino Calancha <tino.calancha <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #20 received at 25243 <at> debbugs.gnu.org (full text, mbox):
below
> > 2. Instead of testing whether the max-length var is nil, I'd suggest
> > testing it with `natnump', to take care of the unexpected case where
> > it might get assigned a non-number.
> Yes, `natnump' is a better choice.
> + (if (or (not (natnump ffap-max-region-length))
> + (< region-len ffap-max-region-length)) ; Bug#25243.
> + (setf ffap-string-at-point-region (list beg end)
> + ffap-string-at-point
> + (buffer-substring-no-properties beg end))
> + (setf ffap-string-at-point-region (list 1 1)
> + ffap-string-at-point ""))))
I'd suggest the other way around. What you have lets someone or
some code assign a non-number and get the same slow behavior we
want to avoid. I'd say (and (natnump ...) (< region-len ...)).
IOW, if it's not a natnump and the size is not smaller than that
number then don't use the region.
The rest sounds good to me.
This bug report was last modified 8 years and 146 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.