From 734588316db662772c2878f37ab8cf567c248a2d Mon Sep 17 00:00:00 2001 From: Matuush Date: Fri, 28 Mar 2025 18:17:13 +0100 Subject: [PATCH] Refactor comments and typedef --- file.hpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/file.hpp b/file.hpp index 755aa8b..1128ac1 100644 --- a/file.hpp +++ b/file.hpp @@ -4,8 +4,6 @@ using std::string; typedef unsigned long long count_type; -class line; -typedef std::pair two_lines; // Treap node representation of a line struct line { @@ -15,6 +13,7 @@ struct line { line(count_type _p, string _t) : priority(_p), text(_t), size(1), left(nullptr), right(nullptr) {} }; +typedef std::pair two_lines; // Treap representation of a file class file { @@ -83,10 +82,10 @@ public: root = nullptr; } // File access - // Don't find index k, but k-th line -> +1 line* find(count_type k) { if(k >= root->size) return nullptr; + // Don't find index k, but k-th line -> +1 return find(root, k+1); }