Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

const_cast can be removed now that cmatchexpression::matches is const #14

Open
edlongman opened this issue Sep 21, 2021 · 0 comments
Open

Comments

@edlongman
Copy link
Owner

bool PacketFilter::matches(const cPacket *cpacket) const
{
MatchableObject matchableObject(MatchableObject::ATTRIBUTE_FULLNAME, cpacket);
// TODO: eliminate const_cast when cMatchExpression::matches becomes const
if (!const_cast<PacketFilter *>(this)->packetMatchExpression.matches(&matchableObject))
return false;
else if (auto packet = dynamic_cast<const Packet *>(cpacket)) {
PacketDissectorCallback callback(*this);
return callback.matches(packet);
}
else

There may be other locations too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant