Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mtxclient
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nheko Reborn
mtxclient
Commits
15f9c462
Commit
15f9c462
authored
5 years ago
by
Nicolas Werner
Browse files
Options
Downloads
Patches
Plain Diff
Reduce required boost components and use std::random instread of boost
parent
7bafeaae
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+2
-23
2 additions, 23 deletions
CMakeLists.txt
lib/utils.cpp
+3
-4
3 additions, 4 deletions
lib/utils.cpp
with
5 additions
and
27 deletions
CMakeLists.txt
+
2
−
23
View file @
15f9c462
...
...
@@ -134,28 +134,12 @@ set_package_properties(nlohmann_json PROPERTIES
)
if
(
USE_BUNDLED_BOOST
)
hunter_add_package
(
Boost
COMPONENTS atomic
chrono
date_time
iostreams
random
regex
system
thread
)
hunter_add_package
(
Boost COMPONENTS iostreams system thread
)
endif
()
#set(Boost_USE_STATIC_LIBS OFF)
#set(Boost_USE_STATIC_RUNTIME OFF)
#set(Boost_USE_MULTITHREADED ON)
find_package
(
Boost 1.70
COMPONENTS atomic
chrono
date_time
iostreams
random
regex
system
thread
)
find_package
(
Boost 1.70 COMPONENTS iostreams system thread
)
set_package_properties
(
Boost PROPERTIES
DESCRIPTION
"Free peer-reviewed portable C++ source libraries"
URL
"https://www.boost.org/"
...
...
@@ -226,12 +210,7 @@ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_link_libraries
(
matrix_client
PUBLIC
Boost::atomic
Boost::chrono
Boost::date_time
Boost::iostreams
Boost::random
Boost::regex
Boost::system
Boost::thread
libsodium::libsodium
...
...
This diff is collapsed.
Click to expand it.
lib/utils.cpp
+
3
−
4
View file @
15f9c462
...
...
@@ -2,6 +2,7 @@
#include
<cctype>
#include
<iomanip>
#include
<random>
#include
<sstream>
#include
<string>
#include
<utility>
...
...
@@ -14,8 +15,6 @@
#include
<boost/iostreams/filter/zlib.hpp>
#include
<boost/iostreams/filtering_stream.hpp>
#include
<boost/iostreams/traits.hpp>
#include
<boost/random/random_device.hpp>
#include
<boost/random/uniform_int_distribution.hpp>
mtx
::
client
::
utils
::
MxcUrl
mtx
::
client
::
utils
::
parse_mxc_url
(
const
std
::
string
&
url
)
...
...
@@ -59,8 +58,8 @@ mtx::client::utils::random_token(uint8_t len, bool with_symbols) noexcept
const
auto
chars
=
with_symbols
?
alphanumberic
+
symbols
:
alphanumberic
;
boost
::
random
::
random_device
rng
;
boost
::
random
::
uniform_int_distribution
<>
index_dist
(
0
,
chars
.
size
()
-
1
);
std
::
random_device
rng
;
std
::
uniform_int_distribution
<>
index_dist
(
0
,
chars
.
size
()
-
1
);
std
::
string
token
;
token
.
reserve
(
len
);
...
...
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