Skip to content

Commit 804d880

Browse files
tniessenruyadorno
authored andcommitted
permission: fix data types in PrintTree
* The first argument `node` should be a const pointer. * The second argument `spaces` should not be a signed integer type. * The local variable `child` should be size_t. * The local variable `pair` in the range declaration should be a reference type to avoid copying the object. Refs: #48677 PR-URL: #48770 Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
1 parent c8da8c8 commit 804d880

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/permission/fs_permission.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ namespace node {
7373

7474
namespace permission {
7575

76-
void PrintTree(FSPermission::RadixTree::Node* node, int spaces = 0) {
76+
void PrintTree(const FSPermission::RadixTree::Node* node, size_t spaces = 0) {
7777
std::string whitespace(spaces, ' ');
7878

7979
if (node == nullptr) {
@@ -90,8 +90,8 @@ void PrintTree(FSPermission::RadixTree::Node* node, int spaces = 0) {
9090
whitespace,
9191
node->prefix);
9292
if (node->children.size()) {
93-
int child = 0;
94-
for (const auto pair : node->children) {
93+
size_t child = 0;
94+
for (const auto& pair : node->children) {
9595
++child;
9696
per_process::Debug(DebugCategory::PERMISSION_MODEL,
9797
"%s Child(%s): %s\n",

0 commit comments

Comments
 (0)