Skip to content

container traits: remove normalisation #237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions src/pygccxml/declarations/container_traits.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ def erase_allocator(self, cls_name, default_allocator='std::allocator'):
container=c_name,
value_type=value_type,
allocator=default_allocator)
if self.normalize(cls_name) == \
self.normalize(tmpl):
if cls_name == tmpl:
return templates.join(
c_name, [self.erase_recursive(value_type)])

Expand All @@ -120,8 +119,8 @@ def erase_container(self, cls_name, default_container_name='std::deque'):
return
value_type = c_args[0]
dc_no_defaults = self.erase_recursive(c_args[1])
if self.normalize(dc_no_defaults) == self.normalize(
templates.join(default_container_name, [value_type])):
if dc_no_defaults == \
templates.join(default_container_name, [value_type]):
return templates.join(
c_name, [self.erase_recursive(value_type)])

Expand All @@ -134,12 +133,12 @@ def erase_container_compare(
if len(c_args) != 3:
return
dc_no_defaults = self.erase_recursive(c_args[1])
if self.normalize(dc_no_defaults) != self.normalize(
templates.join(default_container_name, [c_args[0]])):
if dc_no_defaults != \
templates.join(default_container_name, [c_args[0]]):
return
dcomp_no_defaults = self.erase_recursive(c_args[2])
if self.normalize(dcomp_no_defaults) != self.normalize(
templates.join(default_compare, [c_args[0]])):
if dcomp_no_defaults != \
templates.join(default_compare, [c_args[0]]):
return
value_type = self.erase_recursive(c_args[0])
return templates.join(c_name, [value_type])
Expand All @@ -161,8 +160,7 @@ def erase_compare_allocator(
value_type=value_type,
compare=default_compare,
allocator=default_allocator)
if self.normalize(cls_name) == \
self.normalize(tmpl):
if cls_name == tmpl:
return templates.join(
c_name, [self.erase_recursive(value_type)])

Expand Down Expand Up @@ -193,7 +191,7 @@ def erase_map_compare_allocator(
mapped_type=mapped_type,
compare=default_compare,
allocator=default_allocator)
if self.normalize(cls_name) == self.normalize(tmpl):
if cls_name == tmpl:
return templates.join(
c_name,
[self.erase_recursive(key_type),
Expand Down Expand Up @@ -231,8 +229,7 @@ def erase_hash_allocator(self, cls_name):
less=default_less,
equal_to=default_equal_to,
allocator=default_allocator)
if self.normalize(cls_name) == \
self.normalize(inst):
if cls_name == inst:
return templates.join(
c_name, [self.erase_recursive(value_type)])

Expand Down Expand Up @@ -309,7 +306,7 @@ def erase_hashmap_compare_allocator(self, cls_name):
equal_to=default_equal_to,
allocator=default_allocator)

if self.normalize(cls_name) == self.normalize(inst):
if cls_name == inst:
return templates.join(
c_name,
[self.erase_recursive(key_type),
Expand Down
Loading