diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-08-19 11:23:13 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-08-19 12:12:06 +0200 |
commit | 074790ad6f4e02e7aed3f9c954f0b4005b40fa21 (patch) | |
tree | 442fd746bc73162265a294e16beba61fb4e13b02 /stoc | |
parent | 60485d591882954bbec717bfc0f4ffce8c9e9d5e (diff) |
remove some locking from UriReference
we write these fields in the constructor and then never modify them
again, so safe to skip locking
Change-Id: I5cb5ea085ee8c2f6e4ce6417c2648265aa5a06d1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120704
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'stoc')
-rw-r--r-- | stoc/source/uriproc/UriReference.cxx | 16 | ||||
-rw-r--r-- | stoc/source/uriproc/UriReference.hxx | 6 |
2 files changed, 6 insertions, 16 deletions
diff --git a/stoc/source/uriproc/UriReference.cxx b/stoc/source/uriproc/UriReference.cxx index b5962ea74342..de39330579e2 100644 --- a/stoc/source/uriproc/UriReference.cxx +++ b/stoc/source/uriproc/UriReference.cxx @@ -71,41 +71,34 @@ bool UriReference::isAbsolute() const { OUString UriReference::getSchemeSpecificPart() { - std::lock_guard g(m_mutex); OUStringBuffer buf; appendSchemeSpecificPart(buf); return buf.makeStringAndClear(); } bool UriReference::isHierarchical() { - std::lock_guard g(m_mutex); return m_scheme.isEmpty() || m_hasAuthority || m_path.startsWith("/"); } bool UriReference::hasAuthority() { - std::lock_guard g(m_mutex); return m_hasAuthority; } -OUString UriReference::getAuthority() { - std::lock_guard g(m_mutex); +const OUString& UriReference::getAuthority() { return m_authority; } -OUString UriReference::getPath() { - std::lock_guard g(m_mutex); +const OUString& UriReference::getPath() { return m_path; } bool UriReference::hasRelativePath() { - std::lock_guard g(m_mutex); return !m_hasAuthority && (m_path.isEmpty() || m_path[0] != '/'); } sal_Int32 UriReference::getPathSegmentCount() { - std::lock_guard g(m_mutex); if (m_path.isEmpty()) { return 0; } else { @@ -123,7 +116,6 @@ sal_Int32 UriReference::getPathSegmentCount() OUString UriReference::getPathSegment(sal_Int32 index) { - std::lock_guard g(m_mutex); if (!m_path.isEmpty() && index >= 0) { for (sal_Int32 i = m_path[0] == '/' ? 1 : 0;; ++i) { if (index-- == 0) { @@ -140,12 +132,10 @@ OUString UriReference::getPathSegment(sal_Int32 index) } bool UriReference::hasQuery() { - std::lock_guard g(m_mutex); return m_hasQuery; } -OUString UriReference::getQuery() { - std::lock_guard g(m_mutex); +const OUString& UriReference::getQuery() { return m_query; } diff --git a/stoc/source/uriproc/UriReference.hxx b/stoc/source/uriproc/UriReference.hxx index 90a095873364..9c137e9daa42 100644 --- a/stoc/source/uriproc/UriReference.hxx +++ b/stoc/source/uriproc/UriReference.hxx @@ -55,10 +55,10 @@ public: bool hasAuthority(); /// @throws css::uno::RuntimeException - OUString getAuthority(); + const OUString& getAuthority(); /// @throws css::uno::RuntimeException - OUString getPath(); + const OUString& getPath(); /// @throws css::uno::RuntimeException bool hasRelativePath(); @@ -73,7 +73,7 @@ public: bool hasQuery(); /// @throws css::uno::RuntimeException - OUString getQuery(); + const OUString& getQuery(); /// @throws css::uno::RuntimeException bool hasFragment(); |