diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-08-05 16:22:51 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-08-05 16:22:51 +0000 |
commit | cf46733632c7279a9fd0fe6ce26f9185a4ae82a9 (patch) | |
tree | da27775a2161723ef342e91af41a8b51fedef405 /subversion/libsvn_subr/eol.c | |
parent | bb0ef45f7c46b0ae221b26265ef98a768c33f820 (diff) | |
download | subversion-tarball-master.tar.gz |
subversion-1.9.7HEADsubversion-1.9.7master
Diffstat (limited to 'subversion/libsvn_subr/eol.c')
-rw-r--r-- | subversion/libsvn_subr/eol.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/subversion/libsvn_subr/eol.c b/subversion/libsvn_subr/eol.c index 88a6a37..e63cf11 100644 --- a/subversion/libsvn_subr/eol.c +++ b/subversion/libsvn_subr/eol.c @@ -30,25 +30,10 @@ #include "private/svn_eol_private.h" #include "private/svn_dep_compat.h" -/* Machine-word-sized masks used in svn_eol__find_eol_start. - */ char * svn_eol__find_eol_start(char *buf, apr_size_t len) { -#if !SVN_UNALIGNED_ACCESS_IS_OK - - /* On some systems, we need to make sure that buf is properly aligned - * for chunky data access. This overhead is still justified because - * only lines tend to be tens of chars long. - */ - for (; (len > 0) && ((apr_uintptr_t)buf) & (sizeof(apr_uintptr_t)-1) - ; ++buf, --len) - { - if (*buf == '\n' || *buf == '\r') - return buf; - } - -#endif +#if SVN_UNALIGNED_ACCESS_IS_OK /* Scan the input one machine word at a time. */ for (; len > sizeof(apr_uintptr_t) @@ -62,8 +47,8 @@ svn_eol__find_eol_start(char *buf, apr_size_t len) apr_uintptr_t r_test = chunk ^ SVN__R_MASK; apr_uintptr_t n_test = chunk ^ SVN__N_MASK; - /* A byte in SVN__R_TEST can by < 0x80, iff it has been \0 before - * (i.e. \r in *BUF). Dito for SVN__N_TEST. */ + /* A byte in SVN__R_TEST can only be < 0x80, iff it has been \0 before + * (i.e. \r in *BUF). Ditto for SVN__N_TEST. */ r_test |= (r_test & SVN__LOWER_7BITS_SET) + SVN__LOWER_7BITS_SET; n_test |= (n_test & SVN__LOWER_7BITS_SET) + SVN__LOWER_7BITS_SET; @@ -73,6 +58,8 @@ svn_eol__find_eol_start(char *buf, apr_size_t len) break; } +#endif + /* The remaining odd bytes will be examined the naive way: */ for (; len > 0; ++buf, --len) { |