Skip to content

Commit ef862b5

Browse files
committed
utf8n_to_uvchr_msgs: Move comments close to where they apply
1 parent 09c4dfa commit ef862b5

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

inline.h

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2987,14 +2987,7 @@ Perl_utf8n_to_uvchr_msgs(const U8 *s,
29872987
* simple cases, and, if necessary calls a helper function to deal with the
29882988
* more complex ones. Almost all well-formed non-problematic code points
29892989
* are considered simple, so that it's unlikely that the helper function
2990-
* will need to be called.
2991-
*
2992-
* This is an adaptation of the tables and algorithm given in
2993-
* https://bjoern.hoehrmann.de/utf-8/decoder/dfa/, which provides
2994-
* comprehensive documentation of the original version. A copyright notice
2995-
* for the original version is given at the beginning of this file. The
2996-
* Perl adaptation is documented at the definition of PL_strict_utf8_dfa_tab[].
2997-
*/
2990+
* will need to be called. */
29982991

29992992
const U8 * const s0 = s;
30002993
const U8 * send = s0 + curlen;
@@ -3010,10 +3003,6 @@ Perl_utf8n_to_uvchr_msgs(const U8 *s,
30103003
*msgs = NULL;
30113004
}
30123005

3013-
/* This dfa is fast. If it accepts the input, it was for a well-formed,
3014-
* non-problematic code point, which can be returned immediately.
3015-
* Otherwise we call a helper function to figure out the more complicated
3016-
* cases. */
30173006

30183007
/* No calls from core pass in an empty string; non-core need a check */
30193008
#ifdef PERL_CORE
@@ -3034,7 +3023,19 @@ Perl_utf8n_to_uvchr_msgs(const U8 *s,
30343023
return *s;
30353024
}
30363025

3037-
/* The terminology of the dfa refers to a 'class'. The variable 'type'
3026+
/* This dfa is fast. If it accepts the input, it was for a
3027+
* well-formed, non-problematic code point, which can be returned
3028+
* immediately. Otherwise we call a helper function to figure out the
3029+
* more complicated cases.
3030+
*
3031+
* It is an adaptation of the tables and algorithm given in
3032+
* https://bjoern.hoehrmann.de/utf-8/decoder/dfa/, which provides
3033+
* comprehensive documentation of the original version. A copyright
3034+
* notice for the original version is given at the beginning of this
3035+
* file. The Perl adaptation is documented at the definition of
3036+
* PL_strict_utf8_dfa_tab[].
3037+
*
3038+
* The terminology of the dfa refers to a 'class'. The variable 'type'
30383039
* would have been named 'class' except that is a reserved word in C++
30393040
* */
30403041
PERL_UINT_FAST8_T type = PL_strict_utf8_dfa_tab[*s];

0 commit comments

Comments
 (0)