Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
c237f319
Commit
c237f319
authored
1 year ago
by
Rye Mutt
Browse files
Options
Downloads
Patches
Plain Diff
Reduce string temporaries during LLSD insertion
parent
f5e2acb6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/llcommon/llsd.cpp
+10
-10
10 additions, 10 deletions
indra/llcommon/llsd.cpp
indra/llcommon/llsd.h
+3
-3
3 additions, 3 deletions
indra/llcommon/llsd.h
with
13 additions
and
13 deletions
indra/llcommon/llsd.cpp
+
10
−
10
View file @
c237f319
...
@@ -152,7 +152,7 @@ class LLSD::Impl
...
@@ -152,7 +152,7 @@ class LLSD::Impl
virtual
bool
has
(
const
std
::
string_view
)
const
{
return
false
;
}
virtual
bool
has
(
const
std
::
string_view
)
const
{
return
false
;
}
virtual
LLSD
get
(
const
std
::
string_view
)
const
{
return
LLSD
();
}
virtual
LLSD
get
(
const
std
::
string_view
)
const
{
return
LLSD
();
}
virtual
LLSD
getKeys
()
const
{
return
LLSD
::
emptyArray
();
}
virtual
LLSD
getKeys
()
const
{
return
LLSD
::
emptyArray
();
}
virtual
void
erase
(
const
String
&
)
{
}
virtual
void
erase
(
std
::
string_view
)
{
}
virtual
const
LLSD
&
ref
(
const
std
::
string_view
)
const
{
return
undef
();
}
virtual
const
LLSD
&
ref
(
const
std
::
string_view
)
const
{
return
undef
();
}
virtual
size_t
size
()
const
{
return
0
;
}
virtual
size_t
size
()
const
{
return
0
;
}
...
@@ -403,9 +403,9 @@ namespace
...
@@ -403,9 +403,9 @@ namespace
using
LLSD
::
Impl
::
ref
;
// Unhiding ref(size_t)
using
LLSD
::
Impl
::
ref
;
// Unhiding ref(size_t)
LLSD
get
(
const
std
::
string_view
)
const
override
;
LLSD
get
(
const
std
::
string_view
)
const
override
;
LLSD
getKeys
()
const
override
;
LLSD
getKeys
()
const
override
;
void
insert
(
const
LLSD
::
S
tring
&
k
,
const
LLSD
&
v
);
void
insert
(
const
std
::
s
tring
_view
k
,
const
LLSD
&
v
);
void
erase
(
const
LLSD
::
S
tring
&
)
override
;
void
erase
(
const
std
::
s
tring
_view
)
override
;
LLSD
&
ref
(
const
std
::
string_view
);
LLSD
&
ref
(
const
std
::
string_view
);
const
LLSD
&
ref
(
const
std
::
string_view
)
const
override
;
const
LLSD
&
ref
(
const
std
::
string_view
)
const
override
;
size_t
size
()
const
override
{
return
mData
.
size
();
}
size_t
size
()
const
override
{
return
mData
.
size
();
}
...
@@ -461,13 +461,13 @@ namespace
...
@@ -461,13 +461,13 @@ namespace
return
keys
;
return
keys
;
}
}
void
ImplMap
::
insert
(
const
LLSD
::
S
tring
&
k
,
const
LLSD
&
v
)
void
ImplMap
::
insert
(
const
std
::
s
tring
_view
k
,
const
LLSD
&
v
)
{
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_LLSD
;
LL_PROFILE_ZONE_SCOPED_CATEGORY_LLSD
;
mData
.
emplace
(
DataMap
::
value_type
(
k
,
v
)
)
;
mData
.
emplace
(
k
,
v
);
}
}
void
ImplMap
::
erase
(
const
LLSD
::
S
tring
&
k
)
void
ImplMap
::
erase
(
const
std
::
s
tring
_view
k
)
{
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_LLSD
;
LL_PROFILE_ZONE_SCOPED_CATEGORY_LLSD
;
mData
.
erase
(
k
);
mData
.
erase
(
k
);
...
@@ -944,14 +944,14 @@ LLSD LLSD::emptyMap()
...
@@ -944,14 +944,14 @@ LLSD LLSD::emptyMap()
bool
LLSD
::
has
(
const
std
::
string_view
k
)
const
{
return
safe
(
impl
).
has
(
k
);
}
bool
LLSD
::
has
(
const
std
::
string_view
k
)
const
{
return
safe
(
impl
).
has
(
k
);
}
LLSD
LLSD
::
get
(
const
std
::
string_view
k
)
const
{
return
safe
(
impl
).
get
(
k
);
}
LLSD
LLSD
::
get
(
const
std
::
string_view
k
)
const
{
return
safe
(
impl
).
get
(
k
);
}
LLSD
LLSD
::
getKeys
()
const
{
return
safe
(
impl
).
getKeys
();
}
LLSD
LLSD
::
getKeys
()
const
{
return
safe
(
impl
).
getKeys
();
}
void
LLSD
::
insert
(
const
String
&
k
,
const
LLSD
&
v
)
{
makeMap
(
impl
).
insert
(
k
,
v
);
}
void
LLSD
::
insert
(
const
std
::
string_view
k
,
const
LLSD
&
v
)
{
makeMap
(
impl
).
insert
(
k
,
v
);
}
LLSD
&
LLSD
::
with
(
const
String
&
k
,
const
LLSD
&
v
)
LLSD
&
LLSD
::
with
(
const
std
::
string_view
k
,
const
LLSD
&
v
)
{
{
makeMap
(
impl
).
insert
(
k
,
v
);
makeMap
(
impl
).
insert
(
k
,
v
);
return
*
this
;
return
*
this
;
}
}
void
LLSD
::
erase
(
const
String
&
k
)
{
makeMap
(
impl
).
erase
(
k
);
}
void
LLSD
::
erase
(
const
std
::
string_view
k
)
{
makeMap
(
impl
).
erase
(
k
);
}
LLSD
&
LLSD
::
operator
[](
const
std
::
string_view
k
)
LLSD
&
LLSD
::
operator
[](
const
std
::
string_view
k
)
{
{
...
...
This diff is collapsed.
Click to expand it.
indra/llcommon/llsd.h
+
3
−
3
View file @
c237f319
...
@@ -330,9 +330,9 @@ class LL_COMMON_API LLSD final
...
@@ -330,9 +330,9 @@ class LL_COMMON_API LLSD final
bool
has
(
const
std
::
string_view
)
const
;
bool
has
(
const
std
::
string_view
)
const
;
LLSD
get
(
const
std
::
string_view
)
const
;
LLSD
get
(
const
std
::
string_view
)
const
;
LLSD
getKeys
()
const
;
// Return an LLSD array with keys as strings
LLSD
getKeys
()
const
;
// Return an LLSD array with keys as strings
void
insert
(
const
String
&
,
const
LLSD
&
);
void
insert
(
const
std
::
string_view
,
const
LLSD
&
);
void
erase
(
const
String
&
);
void
erase
(
const
std
::
string_view
);
LLSD
&
with
(
const
String
&
,
const
LLSD
&
);
LLSD
&
with
(
const
std
::
string_view
,
const
LLSD
&
);
LLSD
&
operator
[](
const
std
::
string_view
);
LLSD
&
operator
[](
const
std
::
string_view
);
LLSD
&
operator
[](
const
char
*
c
)
{
return
(
*
this
)[
al
::
safe_string_view
(
c
)];
}
LLSD
&
operator
[](
const
char
*
c
)
{
return
(
*
this
)[
al
::
safe_string_view
(
c
)];
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment