How about replacing the whole function body with

return std::find(entries.begin(), entries.end(), lname);

Would that work?
Same below.