MCPcopy Create free account
hub / github.com/csmith-project/csmith / parse_single_probability

Method parse_single_probability

src/Probabilities.cpp:1025–1039  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1023}
1024
1025bool
1026Probabilities::parse_single_probability(std::string &, const std::string &line)
1027{
1028 std::vector<string> pairs;
1029 StringUtils::split_string(line, pairs, SingleProbElem::single_elem_sep_char);
1030 assert(pairs.size() == 2);
1031
1032 int val = StringUtils::str2int(pairs[1]);
1033 VAL_ASSERT(val);
1034 ProbName pname = get_pname(pairs[0]);
1035 ProbElem *elem = probabilities_[pname];
1036 assert(elem);
1037 elem->set_prob(pname, val);
1038 return true;
1039}
1040
1041const char Probabilities::comment_line_prefix = '#';
1042

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.80
set_probMethod · 0.45

Tested by

no test coverage detected