remove call _strchr

_TEXT	SEGMENT
_c$ = 8							; size = 1
?is_space@@YA_ND@Z PROC					; is_space, COMDAT

; 8    : 	static const char* ws = " \t\n\r\f\v";
; 9    : 	return strchr(ws, c) != nullptr;

	movsx	eax, BYTE PTR _c$[esp-4]
	push	eax
	push	DWORD PTR ?ws@?1??is_space@@YA_ND@Z@4PBDB
	call	_strchr
	add	esp, 8
	neg	eax
	sbb	eax, eax
	neg	eax

; 10   : }
This commit is contained in:
pavel.pimenov 2017-07-12 19:19:46 +03:00 committed by Arvid Norberg
parent 2e79c5e648
commit a422af1a7b
2 changed files with 3 additions and 2 deletions

View File

@ -81,8 +81,7 @@ namespace libtorrent {
bool is_space(char c)
{
static const char* ws = " \t\n\r\f\v";
return strchr(ws, c) != nullptr;
return c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '\f' || c == '\v';
}
char to_lower(char c)

View File

@ -91,6 +91,8 @@ TORRENT_TEST(is_space)
TEST_CHECK(is_space('\t'));
TEST_CHECK(is_space('\n'));
TEST_CHECK(is_space('\r'));
TEST_CHECK(is_space('\f'));
TEST_CHECK(is_space('\v'));
}
TORRENT_TEST(to_lower)