From e2e84563eeb1e7b9add817d2b0c39656fab297d5 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Fri, 18 Mar 2016 13:13:44 -0700 Subject: Use getc_unlocked in a few places. Use getc_unlocked or _fgetc_nolock instead of getc in a few places. This reduces startup time by about 100ms here. Change-Id: I59ceb09678457c871cce79fcc3ce71998fe4f5af Reviewed-on: https://code.wireshark.org/review/14518 Reviewed-by: Michael Mann Petri-Dish: Michael Mann Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- epan/prefs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'epan/prefs.c') diff --git a/epan/prefs.c b/epan/prefs.c index 9a7a66e504..93be10a9ce 100644 --- a/epan/prefs.c +++ b/epan/prefs.c @@ -3463,12 +3463,12 @@ read_prefs_file(const char *pf_path, FILE *pf, } rewind(pf); - while ((got_c = getc(pf)) != EOF) { + while ((got_c = ws_getc_unlocked(pf)) != EOF) { if (got_c == '\r') { /* Treat CR-LF at the end of a line like LF, so that if we're reading * a Windows-format file on UN*X, we handle it the same way we'd handle * a UN*X-format file. */ - got_c = getc(pf); + got_c = ws_getc_unlocked(pf); if (got_c == EOF) break; if (got_c != '\n') { -- cgit v1.2.3