Skip to content

Commit 0f34744

Browse files
committed
applied suggestions
1 parent b395815 commit 0f34744

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

src/xinspect.cpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
/************************************************************************************
2-
* Copyright (c) 2023, xeus-cpp contributors *
2+
* Copyright (c) 2025, xeus-cpp contributors *
33
* *
44
* Distributed under the terms of the BSD 3-Clause License. *
55
* *
66
* The full license is in the file LICENSE, distributed with this software. *
77
************************************************************************************/
88

9+
#include <string>
10+
#include <fstream>
11+
#include <utility>
12+
#include <filesystem>
13+
#include <regex>
14+
915
#include "xinspect.hpp"
1016

1117
#include "clang/Interpreter/CppInterOp.h"
@@ -33,9 +39,13 @@ namespace xcpp
3339

3440
bool class_member_predicate::operator()(pugi::xml_node node) const
3541
{
36-
auto parent = (static_cast<std::string>(node.attribute("kind").value()) == "class"
37-
|| static_cast<std::string>(node.attribute("kind").value()) == "struct")
38-
&& static_cast<std::string>(node.child("name").child_value()) == class_name;
42+
std::string node_kind = node.attribute("kind").value();
43+
std::string node_name = node.child("name").child_value();
44+
45+
bool is_class_or_struct = (node_kind == "class" || node_kind == "struct");
46+
bool name_matches = (node_name == class_name);
47+
bool parent = is_class_or_struct && name_matches;
48+
3949
if (parent)
4050
{
4151
for (pugi::xml_node child : node.children())

src/xinspect.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/************************************************************************************
2-
* Copyright (c) 2023, xeus-cpp contributors *
3-
* Copyright (c) 2023, Martin Vassilev *
2+
* Copyright (c) 2025, xeus-cpp contributors *
43
* *
54
* Distributed under the terms of the BSD 3-Clause License. *
65
* *

0 commit comments

Comments
 (0)