aboutsummaryrefslogtreecommitdiffstats
path: root/src/parsing.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-04-12 03:08:18 +0000
committerlloyd <[email protected]>2008-04-12 03:08:18 +0000
commit66d92bc063a4cbb69e4242a15c3a90daa3db069e (patch)
treef48af6779692e324cbee3ee64cdf45c98a619f5f /src/parsing.cpp
parent21669116db5ccb075d92a24af763f7b8c7a32976 (diff)
Remove Config::option_as_u32bit - the only advantage it had over calling
to_u32but on the return value from Config::option was that it passed it through parse_expr, which did some simple evaluation tricks so you could say 64*1024. That does not seem worth the cost in code, especially because most of the values so controlled are probably never changed. By making them compile time constants, additional optimizations are possible in the source as well as by the compiler. Remove the pkcs8_tries config option. Hardcode that value to 3 instead. I want to rewrite that code in the relatively near future and all that will (hopefully) go away.
Diffstat (limited to 'src/parsing.cpp')
-rw-r--r--src/parsing.cpp28
1 files changed, 0 insertions, 28 deletions
diff --git a/src/parsing.cpp b/src/parsing.cpp
index 3cb61cb44..59c0e3324 100644
--- a/src/parsing.cpp
+++ b/src/parsing.cpp
@@ -211,34 +211,6 @@ bool x500_name_cmp(const std::string& name1, const std::string& name2)
}
/*************************************************
-* Parse and compute an arithmetic expression *
-*************************************************/
-u32bit parse_expr(const std::string& expr)
- {
- const bool have_add = (expr.find('+') != std::string::npos);
- const bool have_mul = (expr.find('*') != std::string::npos);
-
- if(have_add)
- {
- std::vector<std::string> sub_expr = split_on(expr, '+');
- u32bit result = 0;
- for(u32bit j = 0; j != sub_expr.size(); ++j)
- result += parse_expr(sub_expr[j]);
- return result;
- }
- else if(have_mul)
- {
- std::vector<std::string> sub_expr = split_on(expr, '*');
- u32bit result = 1;
- for(u32bit j = 0; j != sub_expr.size(); ++j)
- result *= parse_expr(sub_expr[j]);
- return result;
- }
- else
- return to_u32bit(expr);
- }
-
-/*************************************************
* Convert a decimal-dotted string to binary IP *
*************************************************/
u32bit string_to_ipv4(const std::string& str)