File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919#include < boost/thread/future.hpp>
2020#include < boost/thread/pthread/pthread_helpers.hpp>
2121#include < boost/thread/pthread/pthread_mutex_scoped_lock.hpp>
22+ #include < boost/thread/detail/string_trim.hpp>
2223
2324#ifdef __GLIBC__
2425#include < sys/sysinfo.h>
3334#include < vxCpuLib.h>
3435#endif
3536
36- #include < boost/algorithm/string/split.hpp>
37- #include < boost/algorithm/string/trim.hpp>
3837#include < boost/lexical_cast.hpp>
3938
4039#include < fstream>
@@ -535,16 +534,18 @@ namespace boost
535534 if (line.empty ())
536535 continue ;
537536
538- vector<string> key_val (2 );
539- boost::split (key_val, line, boost::is_any_of (" :" ));
537+ std::size_t i = line.find ( ' :' );
540538
541- if (key_val.size () != 2 )
542- return hardware_concurrency ();
539+ if ( i == std::string::npos )
540+ {
541+ return hardware_concurrency ();
542+ }
543+
544+ std::string key = line.substr ( 0 , i );
545+ std::string value = line.substr ( i+1 );
543546
544- string key = key_val[0 ];
545- string value = key_val[1 ];
546- boost::trim (key);
547- boost::trim (value);
547+ key = thread_detail::string_trim ( key );
548+ value = thread_detail::string_trim ( value );
548549
549550 if (key == physical_id) {
550551 current_core_entry.first = boost::lexical_cast<unsigned >(value);
You can’t perform that action at this time.
0 commit comments