Bug 1719550 - Unify collator in nsDirectoryIndexStream.cpp; r=platform-i18n-reviewers,necko-reviewers,nordzilla

Differential Revision: https://phabricator.services.mozilla.com/D121431
This commit is contained in:
Greg Tatum 2021-08-10 11:46:37 +00:00
parent 8066c9d047
commit a7f0aa2461

View File

@ -17,10 +17,6 @@
#include "nsDirectoryIndexStream.h"
#include "mozilla/Logging.h"
#include "prtime.h"
#ifdef THREADSAFE_I18N
# include "nsCollationCID.h"
# include "nsICollation.h"
#endif
#include "nsIFile.h"
#include "nsURLHelper.h"
#include "nsNativeCharsetUtils.h"
@ -31,9 +27,6 @@
// is threadsafe.
// So THIS CODE IS ASCII ONLY!!!!!!!! This is no worse than the current
// behaviour, though. See bug 99382.
// When this is fixed, #define THREADSAFE_I18N to get this code working
//#define THREADSAFE_I18N
using namespace mozilla;
static LazyLogModule gLog("nsDirectoryIndexStream");
@ -100,19 +93,7 @@ nsresult nsDirectoryIndexStream::Init(nsIFile* aDir) {
mArray.AppendObject(file); // addrefs
}
#ifdef THREADSAFE_I18N
nsCOMPtr<nsICollationFactory> cf =
do_CreateInstance(NS_COLLATIONFACTORY_CONTRACTID, &rv);
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsICollation> coll;
rv = cf->CreateCollation(getter_AddRefs(coll));
if (NS_FAILED(rv)) return rv;
mArray.Sort(compare, coll);
#else
mArray.Sort(compare, nullptr);
#endif
mBuf.AppendLiteral("300: ");
nsAutoCString url;