mirror of
https://github.com/KnugiHK/WhatsApp-Chat-Exporter.git
synced 2026-05-21 16:28:45 +00:00
Attempt to fix the perf issue in selectattr | first filter (#209)
Replace O(n²) Jinja2 filter searches with an O(1) dictionary lookup.
This commit is contained in:
@@ -355,7 +355,7 @@
|
||||
{% endif %}
|
||||
</p>
|
||||
</div>
|
||||
{% set replied_msg = msgs | selectattr('key_id', 'equalto', msg.reply) | first %}
|
||||
{% set replied_msg = msg_map(msg.reply) %}
|
||||
{% if replied_msg and replied_msg.media == true %}
|
||||
<div class="flex-shrink-0">
|
||||
{% if "image/" in replied_msg.mime %}
|
||||
@@ -461,7 +461,7 @@
|
||||
{% endif %}
|
||||
</p>
|
||||
</div>
|
||||
{% set replied_msg = msgs | selectattr('key_id', 'equalto', msg.reply) | first %}
|
||||
{% set replied_msg = msg_map(msg.reply) %}
|
||||
{% if replied_msg and replied_msg.media == true %}
|
||||
<div class="flex-shrink-0">
|
||||
{% if "image/" in replied_msg.mime %}
|
||||
|
||||
Reference in New Issue
Block a user