Skip to content

Conversation

@elektrischermoench
Copy link
Contributor

…d unused inclcudes

the function _process_reg_file was duplicated in two different locations with exactly the same code. Moved everything to misc.py.

Only difference is some formatting stuff:

@@ -1,4 +1,3 @@
-
 def _process_reg_file(ubifs, inode, path, inodes):
     try:
         buf = bytearray()
@@ -9,7 +8,6 @@
             last_khash = start_key - 1

             for data in sorted_data:
-
                 # If data nodes are missing in sequence, fill in blanks
                 # with \x00 * UBIFS_BLOCK_SIZE
                 if data.key['khash'] - last_khash != 1:
@@ -35,6 +33,7 @@
                     d = d[:data.plaintext_size]

                 buf += decompress(compr_type, data.size, d)
+
                 last_khash = data.key['khash']
                 verbose_log(_process_reg_file, 'ino num: %s, compression: %s, path: %s' % (inode['ino'].key['ino_num'], compr_type, path))

Copy link
Contributor

@e3krisztian e3krisztian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for removing this duplication!

@qkaiser qkaiser merged commit fe33586 into onekey-sec:main Jun 11, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants