From ea9d1f69fbcbdb621057b0059bf22bfa738802b8 Mon Sep 17 00:00:00 2001 From: Justin Viiret Date: Wed, 17 Jan 2018 10:59:58 +1100 Subject: [PATCH] rose_build_add: remove unused max_adj param In prepAcceptForAddAnchoredNFA(), we used to support different values for max_adj. Since it's now always zero, remove it. --- src/rose/rose_build_add.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/rose/rose_build_add.cpp b/src/rose/rose_build_add.cpp index 71f1667d..08f253cb 100644 --- a/src/rose/rose_build_add.cpp +++ b/src/rose/rose_build_add.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2017, Intel Corporation + * Copyright (c) 2015-2018, Intel Corporation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -1849,13 +1849,12 @@ bool RoseBuildImpl::addChainTail(const raw_puff &rp, u32 *queue_out, return true; /* failure is not yet an option */ } - static bool prepAcceptForAddAnchoredNFA(RoseBuildImpl &tbi, const NGHolder &w, - u32 max_adj, NFAVertex u, + NFAVertex u, const vector &vertexDepths, map &depthMap, - map > &reportMap, + map> &reportMap, map &allocated_reports, flat_set &added_lit_ids) { const depth max_anchored_depth(tbi.cc.grey.maxAnchoredRegion); @@ -1883,9 +1882,9 @@ bool prepAcceptForAddAnchoredNFA(RoseBuildImpl &tbi, const NGHolder &w, depthMap[lit_id] = unionDepthMinMax(depthMap[lit_id], d); } - if (depthMap[lit_id].max + depth(max_adj) > max_anchored_depth) { + if (depthMap[lit_id].max > max_anchored_depth) { DEBUG_PRINTF("depth=%s exceeds maxAnchoredRegion=%u\n", - (depthMap[lit_id].max + depth(max_adj)).str().c_str(), + depthMap[lit_id].max.str().c_str(), tbi.cc.grey.maxAnchoredRegion); return false; } @@ -1932,7 +1931,7 @@ bool RoseBuildImpl::addAnchoredAcyclic(const NGHolder &h) { flat_set added_lit_ids; /* literal ids added for this NFA */ for (auto v : inv_adjacent_vertices_range(h.accept, h)) { - if (!prepAcceptForAddAnchoredNFA(*this, h, 0, v, vertexDepths, depthMap, + if (!prepAcceptForAddAnchoredNFA(*this, h, v, vertexDepths, depthMap, reportMap, allocated_reports, added_lit_ids)) { removeAddedLiterals(*this, added_lit_ids); @@ -1946,7 +1945,7 @@ bool RoseBuildImpl::addAnchoredAcyclic(const NGHolder &h) { if (v == h.accept) { continue; } - if (!prepAcceptForAddAnchoredNFA(*this, h, 0, v, vertexDepths, depthMap, + if (!prepAcceptForAddAnchoredNFA(*this, h, v, vertexDepths, depthMap, reportMap, allocated_reports_eod, added_lit_ids)) { removeAddedLiterals(*this, added_lit_ids);