Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
sammycage committed Jan 13, 2024
1 parent 1ff02e7 commit 56922f3
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions source/parser.cpp
Expand Up @@ -1379,7 +1379,6 @@ bool StyleSheet::parseSelectors(const char*& ptr, const char* end, SelectorList&

while(Utils::skipDesc(ptr, end, ',')) {
Utils::skipWs(ptr, end);
Selector selector;
if(!parseSelector(ptr, end, selector))
return false;
selectors.push_back(std::move(selector));
Expand Down Expand Up @@ -1823,18 +1822,18 @@ bool Document::parse(const char* data, std::size_t size)
if(ptr >= end || *ptr != quote)
return false;

auto id = PropertyID::Unknown;
auto attrId = PropertyID::Unknown;
if(element != nullptr)
id = propertyid(name);
if(id != PropertyID::Unknown) {
attrId = propertyid(name);
if(attrId != PropertyID::Unknown) {
decodeText(start, Utils::rtrim(start, ptr), value);
if(id == PropertyID::Style) {
if(attrId == PropertyID::Style) {
removeComments(value);
parseStyle(value, element);
} else {
if(id == PropertyID::Id)
if(attrId == PropertyID::Id)
m_idCache.emplace(value, element);
element->set(id, value, 0x1);
element->set(attrId, value, 0x1);
}
}

Expand Down

0 comments on commit 56922f3

Please sign in to comment.