Speeding up Unicode validation.
(The measurable effect (during long searches, for example) is zero, though.) git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5773 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
e258cc3e95
commit
f9d6aa9ba3
|
@ -5,6 +5,7 @@
|
||||||
an invalid escape sequence, and when entering a verbatim keystroke.
|
an invalid escape sequence, and when entering a verbatim keystroke.
|
||||||
Leave the cursor off during Unicode input, for extra feedback.
|
Leave the cursor off during Unicode input, for extra feedback.
|
||||||
* src/browser.c (do_browser): Improve the wording of a message.
|
* src/browser.c (do_browser): Improve the wording of a message.
|
||||||
|
* src/chars.c (is_valid_unicode): Speed up Unicode validation.
|
||||||
|
|
||||||
2016-03-28 Benno Schulenberg <bensberg@justemail.net>
|
2016-03-28 Benno Schulenberg <bensberg@justemail.net>
|
||||||
* src/winio.c (statusbar): Don't bother putting back the cursor in
|
* src/winio.c (statusbar): Don't bother putting back the cursor in
|
||||||
|
|
|
@ -955,9 +955,10 @@ bool has_blank_mbchars(const char *s)
|
||||||
/* Return TRUE if wc is valid Unicode, and FALSE otherwise. */
|
/* Return TRUE if wc is valid Unicode, and FALSE otherwise. */
|
||||||
bool is_valid_unicode(wchar_t wc)
|
bool is_valid_unicode(wchar_t wc)
|
||||||
{
|
{
|
||||||
return ((0 <= wc && wc <= 0x10FFFF) && (wc <= 0xD7FF || 0xE000 <=
|
return ((0 <= wc && wc <= 0xD7FF) ||
|
||||||
wc) && (wc <= 0xFDCF || 0xFDF0 <= wc) && ((wc & 0xFFFF) <=
|
(0xE000 <= wc && wc <= 0xFDCF) ||
|
||||||
0xFFFD));
|
(0xFDF0 <= wc && wc <= 0xFFFD) ||
|
||||||
|
(0xFFFF < wc && wc <= 0x10FFFF && (wc & 0xFFFF) <= 0xFFFD));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue