diff options
author | Patrick Venture <venture@google.com> | 2018-04-17 15:19:03 -0700 |
---|---|---|
committer | Patrick Venture <venture@google.com> | 2018-04-18 14:06:11 -0700 |
commit | 73a50c7f1cd02fca7cbc69e6304514157c59fa63 (patch) | |
tree | 12bae0926bfaa853bb00e6b20775f6c5e30d3b1f | |
parent | caac77dc638377c67db15ca2db9d72d05076841b (diff) | |
download | phosphor-hwmon-73a50c7f1cd02fca7cbc69e6304514157c59fa63.tar.gz phosphor-hwmon-73a50c7f1cd02fca7cbc69e6304514157c59fa63.zip |
mainloop: Add some helpful comments
Added a couple helpful comments that save someone
from reading the code and thinking about it to know
what it does.
Change-Id: Ieac770e99fbd75a42be6803ee7959aba6ad6e96a
Signed-off-by: Patrick Venture <venture@google.com>
-rw-r--r-- | mainloop.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mainloop.cpp b/mainloop.cpp index c93beb8..62467fd 100644 --- a/mainloop.cpp +++ b/mainloop.cpp @@ -450,12 +450,15 @@ MainLoop::MainLoop( _isOCC = true; } + // Strip off any trailing slashes. std::string p = path; while (!p.empty() && p.back() == '/') { p.pop_back(); } + // Given the furthest right /, set instance to + // the basename, and hwmonRoot to the leading path. auto n = p.rfind('/'); if (n != std::string::npos) { |