Title: [292428] trunk/Source/_javascript_Core
- Revision
- 292428
- Author
- [email protected]
- Date
- 2022-04-05 14:48:50 -0700 (Tue, 05 Apr 2022)
Log Message
Avoid unnecessary String constructions in IdentifiersFactory.cpp
https://bugs.webkit.org/show_bug.cgi?id=238819
Reviewed by Geoffrey Garen.
* inspector/IdentifiersFactory.cpp:
(Inspector::addPrefixToIdentifier):
(Inspector::IdentifiersFactory::createIdentifier):
(Inspector::IdentifiersFactory::requestId):
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (292427 => 292428)
--- trunk/Source/_javascript_Core/ChangeLog 2022-04-05 21:38:40 UTC (rev 292427)
+++ trunk/Source/_javascript_Core/ChangeLog 2022-04-05 21:48:50 UTC (rev 292428)
@@ -1,5 +1,17 @@
2022-04-05 Chris Dumez <[email protected]>
+ Avoid unnecessary String constructions in IdentifiersFactory.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=238819
+
+ Reviewed by Geoffrey Garen.
+
+ * inspector/IdentifiersFactory.cpp:
+ (Inspector::addPrefixToIdentifier):
+ (Inspector::IdentifiersFactory::createIdentifier):
+ (Inspector::IdentifiersFactory::requestId):
+
+2022-04-05 Chris Dumez <[email protected]>
+
Mark String(const char*) constructor as explicit
https://bugs.webkit.org/show_bug.cgi?id=238693
Modified: trunk/Source/_javascript_Core/inspector/IdentifiersFactory.cpp (292427 => 292428)
--- trunk/Source/_javascript_Core/inspector/IdentifiersFactory.cpp 2022-04-05 21:38:40 UTC (rev 292427)
+++ trunk/Source/_javascript_Core/inspector/IdentifiersFactory.cpp 2022-04-05 21:48:50 UTC (rev 292428)
@@ -27,13 +27,15 @@
#include "config.h"
#include "IdentifiersFactory.h"
+#include <wtf/text/StringConcatenateNumbers.h>
+
namespace Inspector {
namespace {
-static long s_lastUsedIdentifier = 0;
+static unsigned long s_lastUsedIdentifier = 0;
}
-static String addPrefixToIdentifier(const String& identifier)
+static String addPrefixToIdentifier(unsigned long identifier)
{
return makeString("0.", identifier);
}
@@ -40,14 +42,12 @@
String IdentifiersFactory::createIdentifier()
{
- return addPrefixToIdentifier(String::number(++s_lastUsedIdentifier));
+ return addPrefixToIdentifier(++s_lastUsedIdentifier);
}
String IdentifiersFactory::requestId(unsigned long identifier)
{
- if (identifier)
- return addPrefixToIdentifier(String::number(identifier));
- return String();
+ return identifier ? addPrefixToIdentifier(identifier) : String();
}
} // namespace Inspector
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes