From 03fe5803de7cfb960e4358bed119b6f1a441f334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Wed, 17 Apr 2024 19:00:06 +0800 Subject: [PATCH] common/properties: we don't use threads any more --- src/common/properties.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/common/properties.c b/src/common/properties.c index f5180aa11..3dead5045 100644 --- a/src/common/properties.c +++ b/src/common/properties.c @@ -154,16 +154,13 @@ bool ffParsePropFileListValues(const FFlist* list, const char* relativeFile, uin { bool foundAFile = false; - FF_STRBUF_AUTO_DESTROY baseDir = ffStrbufCreateA(64); - FF_LIST_FOR_EACH(FFstrbuf, dirPrefix, *list) { - //We need to copy the dir each time, because it used by multiple threads, so we can't directly write to it. - ffStrbufSet(&baseDir, dirPrefix); - ffStrbufAppendS(&baseDir, relativeFile); - - if(ffParsePropFileValues(baseDir.chars, numQueries, queries)) + const uint32_t dirPrefixLength = dirPrefix->length; + ffStrbufAppendS(dirPrefix, relativeFile); + if(ffParsePropFileValues(dirPrefix->chars, numQueries, queries)) foundAFile = true; + ffStrbufSubstrBefore(dirPrefix, dirPrefixLength); bool allSet = true; for(uint32_t k = 0; k < numQueries; k++)