Skip to content

Commit

Permalink
q-dev: minor optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrbartman committed Jun 1, 2024
1 parent f9f84be commit 0be9633
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion qubesusbproxy/core3ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,9 @@ def _sanitize(
# rb'USB\x202.0\x20Camera' -> 'USB 2.0 Camera'
untrusted_device_desc = untrusted_device_desc.decode(
'unicode_escape', errors='ignore')
safe_chars_set = set(safe_chars)
return ''.join(
c if c in set(safe_chars) else '_' for c in untrusted_device_desc
c if c in safe_chars_set else '_' for c in untrusted_device_desc
)

@property
Expand Down

0 comments on commit 0be9633

Please sign in to comment.