eric6/HexEdit/HexEditChunks.py

changeset 8259
2bbec88047dd
parent 8207
d359172d11be
--- a/eric6/HexEdit/HexEditChunks.py	Wed Apr 21 17:56:12 2021 +0200
+++ b/eric6/HexEdit/HexEditChunks.py	Wed Apr 21 19:40:50 2021 +0200
@@ -301,10 +301,11 @@
             # position is out of range, do nothing
             return False
         
-        if pos == self.__size:
-            chunkIdx = self.__getChunkIndex(pos - 1)
-        else:
-            chunkIdx = self.__getChunkIndex(pos)
+        chunkIdx = (
+            self.__getChunkIndex(pos - 1)
+            if pos == self.__size else
+            self.__getChunkIndex(pos)
+        )
         chunk = self.__chunks[chunkIdx]
         posInChunk = pos - chunk.absPos
         chunk.data.insert(posInChunk, data)

eric ide

mercurial