Skip to content

Commit 11f4da6

Browse files
committed
style: some cleanup
1 parent fc46ac3 commit 11f4da6

File tree

1 file changed

+5
-42
lines changed

1 file changed

+5
-42
lines changed

src/core/extension.cpp

Lines changed: 5 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ struct Extension::Impl {
6161
std::shared_ptr<IAssembly> assembly;
6262
} moduleData;
6363

64-
void Cache() {
64+
void Init() {
6565
fs::path path = std::move(location);
6666
location = path.parent_path();
6767
if (type == ExtensionType::Module) {
@@ -297,16 +297,6 @@ bool Extension::HasWarnings() const noexcept {
297297
return !_impl->warnings.empty();
298298
}
299299

300-
/*bool Extension::IsLoaded() const noexcept {
301-
switch (_impl->state) {
302-
case ExtensionState::Loaded:
303-
case ExtensionState::Started:
304-
return true;
305-
default:
306-
return false;
307-
}
308-
}*/
309-
310300
// ============================================================================
311301
// Timing/Performance Getters
312302
// ============================================================================
@@ -387,7 +377,7 @@ void Extension::SetLanguageModule(ILanguageModule* module) {
387377

388378
void Extension::SetManifest(Manifest manifest) {
389379
_impl->manifest = std::move(manifest);
390-
_impl->Cache();
380+
_impl->Init();
391381
}
392382

393383
// ============================================================================
@@ -427,11 +417,6 @@ auto Extension::operator<=>(const Extension& other) const noexcept {
427417
// ============================================================================
428418

429419
plg::path_view Extension::GetFileExtension(ExtensionType type) {
430-
/*switch(type) {
431-
case ExtensionType::Plugin: return ".pplugin";
432-
case ExtensionType::Module: return ".pmodule";
433-
default: return "";
434-
}*/
435420
switch (type) {
436421
case ExtensionType::Plugin:
437422
return PLUGIFY_PATH_LITERAL(".pplugin");
@@ -443,12 +428,10 @@ plg::path_view Extension::GetFileExtension(ExtensionType type) {
443428
}
444429

445430
ExtensionType Extension::GetExtensionType(const std::filesystem::path& path) {
446-
/*static std::unordered_map<std::string, ExtensionType, plg::case_insensitive_hash,
447-
plg::case_insensitive_equal> manifests = { { ".pplugin", ExtensionType::Plugin }, { ".pmodule",
448-
ExtensionType::Module }
431+
constexpr std::array extensions = {
432+
ExtensionType::Module,
433+
ExtensionType::Plugin
449434
};
450-
return manifests[plg::as_string(path.extension())];*/
451-
std::array extensions = { ExtensionType::Module, ExtensionType::Plugin };
452435
for (const auto& extension : extensions) {
453436
if (plg::has_extension(path, GetFileExtension(extension))) {
454437
return extension;
@@ -551,26 +534,6 @@ const std::string& Extension::GetVersionString() const noexcept {
551534
return _impl->version;
552535
}
553536

554-
// Helper to check if extension can be loaded
555-
/*bool Extension::CanLoad() const noexcept {
556-
return (_impl->state == ExtensionState::Loading) && !HasErrors();
557-
}
558-
559-
// Helper to check if extension can be started
560-
bool Extension::CanStart() const noexcept {
561-
return _impl->state == ExtensionState::Loaded && !HasErrors();
562-
}
563-
564-
// Helper to check if extension can be updated
565-
bool Extension::CanUpdate() const noexcept {
566-
return _impl->state == ExtensionState::Started && !HasErrors();
567-
}
568-
569-
// Helper to check if extension can be stopped
570-
bool Extension::CanStop() const noexcept {
571-
return _impl->state == ExtensionState::Started && !HasErrors();
572-
}*/
573-
574537
// Add dependency helper (for runtime dependency injection)
575538
void Extension::AddDependency(std::string dep) {
576539
if (!_impl->manifest.dependencies) {

0 commit comments

Comments
 (0)