From e7539b139ae6851cf6ed92a7741d38875e4c0909 Mon Sep 17 00:00:00 2001 From: Steve Block Date: Fri, 20 Nov 2009 15:27:15 +0000 Subject: Removes Android-specific wrapper for std::sort in Profile class. It appears that previosuly, a wrapper function was required to perform the required type casting when passing a custom comparison function to Android's std::sort. This is no longer required, so the wrapper can be removed. Change-Id: I30add3d6b41eca2558867755a34dda21a180166f --- JavaScriptCore/profiler/Profile.cpp | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'JavaScriptCore/profiler') diff --git a/JavaScriptCore/profiler/Profile.cpp b/JavaScriptCore/profiler/Profile.cpp index 0a290ce..de75e71 100644 --- a/JavaScriptCore/profiler/Profile.cpp +++ b/JavaScriptCore/profiler/Profile.cpp @@ -29,13 +29,6 @@ #include "ProfileNode.h" #include -#if PLATFORM(ANDROID) -typedef bool (* Comparator)(const void*, const void*); -namespace std { -extern void sort(const void** start, const void** end, Comparator comp); -} -#endif - namespace JSC { PassRefPtr Profile::create(const UString& title, unsigned uid) @@ -115,15 +108,6 @@ void Profile::debugPrintData() const typedef pair NameCountPair; -#if PLATFORM(ANDROID) -typedef bool (* NameCountPairComparator)(const NameCountPair&, const NameCountPair&); - -inline void _sort(NameCountPair* start, NameCountPair* end, NameCountPairComparator comp) -{ - std::sort((const void**) start, (const void**) end, (Comparator) comp); -} -#endif - static inline bool functionNameCountPairComparator(const NameCountPair& a, const NameCountPair& b) { return a.second > b.second; @@ -141,11 +125,7 @@ void Profile::debugPrintDataSampleStyle() const NameCountPairVector sortedFunctions(countedFunctions.size()); copyToVector(countedFunctions, sortedFunctions); -#if PLATFORM(ANDROID) - _sort(sortedFunctions.begin(), sortedFunctions.end(), functionNameCountPairComparator); -#else std::sort(sortedFunctions.begin(), sortedFunctions.end(), functionNameCountPairComparator); -#endif for (NameCountPairVector::iterator it = sortedFunctions.begin(); it != sortedFunctions.end(); ++it) printf(" %-12d%s\n", (*it).second, UString((*it).first).UTF8String().c_str()); -- cgit v1.1