Skip to content

Commit

Permalink
compact (#617)
Browse files Browse the repository at this point in the history
Co-authored-by: Kenny Kerr <[email protected]>
  • Loading branch information
kennykerr and kennykerr authored May 12, 2020
1 parent b95c4f3 commit ede55c0
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions cppwinrt/component_writers.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ namespace cppwinrt
if (settings.component_opt)
{
auto format = R"(
if (requal(name, L"%.%"))
if (requal(name, "%.%"))
{
return winrt_make_%();
}
Expand All @@ -120,7 +120,7 @@ namespace cppwinrt
else
{
auto format = R"(
if (requal(name, L"%.%"))
if (requal(name, "%.%"))
{
return winrt::detach_abi(winrt::make<winrt::@::factory_implementation::%>());
}
Expand Down Expand Up @@ -149,9 +149,11 @@ bool __stdcall %_can_unload_now() noexcept
return true;
}
void* __stdcall %_get_activation_factory([[maybe_unused]] std::wstring_view const& name)
void* __stdcall %_get_activation_factory([[maybe_unused]] std::wstring_view const& wname)
{
auto requal = [](std::wstring_view const& left, std::wstring_view const& right) noexcept
auto name = winrt::to_string(wname);
auto requal = [](std::string_view const& left, std::string_view const& right) noexcept
{
return std::equal(left.rbegin(), left.rend(), right.rbegin(), right.rend());
};
Expand Down Expand Up @@ -750,7 +752,7 @@ catch (...) { return winrt::to_hresult(); }
%
hstring GetRuntimeClassName() const
{
return L"%.%";
return name_of<class_type>();
}
%%%% };
}
Expand Down Expand Up @@ -820,8 +822,6 @@ catch (...) { return winrt::to_hresult(); }
type_name,
type_name,
composable_base_name,
type_namespace,
type_name,
bind<write_component_class_override_constructors>(type),
bind<write_component_override_dispatch_base>(type),
bind<write_component_base_call>(type),
Expand All @@ -839,7 +839,7 @@ catch (...) { return winrt::to_hresult(); }
hstring GetRuntimeClassName() const
{
return L"%.%";
return name_of<instance_type>();
}
% };
}
Expand All @@ -851,8 +851,6 @@ catch (...) { return winrt::to_hresult(); }
bind<write_component_factory_interfaces>(factories),
type_namespace,
type_name,
type_namespace,
type_name,
bind<write_component_forwarders>(factories));
}

Expand Down

0 comments on commit ede55c0

Please sign in to comment.