Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7123580
D8527.id30726.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
699 B
Subscribers
None
D8527.id30726.diff
View Options
diff --git a/swh/model/git_objects.py b/swh/model/git_objects.py
--- a/swh/model/git_objects.py
+++ b/swh/model/git_objects.py
@@ -55,12 +55,16 @@
def directory_entry_sort_key(entry: model.DirectoryEntry):
"""The sorting key for tree entries"""
if isinstance(entry, dict):
- # For backward compatibility
- entry = model.DirectoryEntry.from_dict(entry)
- if entry.type == "dir":
- return entry.name + b"/"
+ type_ = entry["type"]
+ name = entry["name"]
+ else:
+ type_ = entry.type
+ name = entry.name
+
+ if type_ == "dir":
+ return name + b"/"
else:
- return entry.name
+ return name
@lru_cache()
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 19, 11:48 AM (14 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3222976
Attached To
D8527: model: avoid another extra creation of Model object
Event Timeline
Log In to Comment