Permalink
Browse files

use mie::findChar ; pi 2 sec

  • Loading branch information...
herumi committed Jul 1, 2018
1 parent f1de737 commit 3a308175d3f6d084d96f3511133f1d94d05eaba9
Showing with 1,123 additions and 0 deletions.
  1. +12 −0 raw/get_result_with_log.cpp
  2. +1,111 −0 raw/mie/string.hpp
@@ -5,6 +5,7 @@
#include <sstream>
#include <vector>
#include <iomanip>
#include "mie/string.hpp"
using namespace std;
@@ -31,6 +32,16 @@ const string ERROR_SUFFIX = "-error";
const string MAX_SUFFIX = "-max";
int find_place(const string& irrational_value, const string& time){
#if 1
const char *begin = irrational_value.c_str();
const char *end = begin + irrational_value.size();
const char *p = mie::findStr(begin, end, time.c_str(), time.size());
if (p != end) {
return int(p - begin);
} else {
return -1;
}
#else
string::size_type position = irrational_value.find(time);
@@ -40,6 +51,7 @@ int find_place(const string& irrational_value, const string& time){
// cout << "find position is ... " << position << endl;
return position;
#endif
}
string get_digit_seq(const string& irrational_value, int current_pos){
Oops, something went wrong.

0 comments on commit 3a30817

Please sign in to comment.