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
16f26f55
Commit
16f26f55
authored
4 years ago
by
Rye Mutt
Browse files
Options
Downloads
Patches
Plain Diff
Replace ostringstream with llformat for faster.
parent
c26de493
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/llfilesystem/lldiskcache.cpp
+2
-26
2 additions, 26 deletions
indra/llfilesystem/lldiskcache.cpp
with
2 additions
and
26 deletions
indra/llfilesystem/lldiskcache.cpp
+
2
−
26
View file @
16f26f55
...
@@ -183,24 +183,7 @@ const std::string LLDiskCache::metaDataToFilepath(const std::string id,
...
@@ -183,24 +183,7 @@ const std::string LLDiskCache::metaDataToFilepath(const std::string id,
LLAssetType
::
EType
at
,
LLAssetType
::
EType
at
,
const
std
::
string
extra_info
)
const
std
::
string
extra_info
)
{
{
std
::
ostringstream
file_path
;
return
llformat
(
"%s%s%s_%s_%s"
,
mCacheDir
.
c_str
(),
gDirUtilp
->
getDirDelimiter
().
c_str
(),
mCacheFilenamePrefix
.
c_str
(),
id
.
c_str
(),
(
extra_info
.
empty
()
?
"0"
:
extra_info
.
c_str
()));
file_path
<<
mCacheDir
;
file_path
<<
gDirUtilp
->
getDirDelimiter
();
file_path
<<
mCacheFilenamePrefix
;
file_path
<<
"_"
;
file_path
<<
id
;
file_path
<<
"_"
;
file_path
<<
(
extra_info
.
empty
()
?
"0"
:
extra_info
);
//file_path << "_";
//file_path << assetTypeToString(at); // see SL-14210 Prune descriptive tag from new cache filenames
// for details of why it was removed. Note that if you put it
// back or change the format of the filename, the cache files
// files will be invalidated (and perhaps, more importantly,
// never deleted unless you delete them manually).
file_path
<<
".asset"
;
return
file_path
.
str
();
}
}
void
LLDiskCache
::
updateFileAccessTime
(
const
std
::
string
file_path
)
void
LLDiskCache
::
updateFileAccessTime
(
const
std
::
string
file_path
)
...
@@ -252,17 +235,10 @@ void LLDiskCache::updateFileAccessTime(const std::string file_path)
...
@@ -252,17 +235,10 @@ void LLDiskCache::updateFileAccessTime(const std::string file_path)
const
std
::
string
LLDiskCache
::
getCacheInfo
()
const
std
::
string
LLDiskCache
::
getCacheInfo
()
{
{
std
::
ostringstream
cache_info
;
F32
max_in_mb
=
(
F32
)
mMaxSizeBytes
/
(
1024.0
*
1024.0
);
F32
max_in_mb
=
(
F32
)
mMaxSizeBytes
/
(
1024.0
*
1024.0
);
F32
percent_used
=
((
F32
)
dirFileSize
(
mCacheDir
)
/
(
F32
)
mMaxSizeBytes
)
*
100.0
;
F32
percent_used
=
((
F32
)
dirFileSize
(
mCacheDir
)
/
(
F32
)
mMaxSizeBytes
)
*
100.0
;
cache_info
<<
std
::
fixed
;
return
llformat
(
"Max size %1.f MB (%.1f %% used)"
,
max_in_mb
,
percent_used
);
cache_info
<<
std
::
setprecision
(
1
);
cache_info
<<
"Max size "
<<
max_in_mb
<<
" MB "
;
cache_info
<<
"("
<<
percent_used
<<
"% used)"
;
return
cache_info
.
str
();
}
}
void
LLDiskCache
::
clearCache
()
void
LLDiskCache
::
clearCache
()
...
...
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