Skip to content

Commit

Permalink
Slight cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
JarrettSJohnson committed Mar 31, 2024
1 parent 542fbd0 commit 23bef14
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
4 changes: 0 additions & 4 deletions layer2/CifFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,6 @@ const cif_array * cif_data::get_arr(const char * key) const {
if (columnIt == category.end()) {
return nullptr;
}
auto arr = &columnIt->second;
auto& arrPtr = std::get<cif_detail::bcif_array>(arr->m_array);
return &columnIt->second;
}

Expand Down Expand Up @@ -623,7 +621,6 @@ static std::vector<CifArrayElement> run_length_decode(
std::vector<CifArrayElement>& data, DataTypes srcType, int srcSize)
{
std::vector<CifArrayElement> result;
std::int32_t value = 0;
for (std::size_t i = 0; i < data.size(); i += 2) {
auto item = std::get<std::int32_t>(data[i]);
auto count = std::get<std::int32_t>(data[i + 1]);
Expand Down Expand Up @@ -778,7 +775,6 @@ bool cif_file::parse_bcif(const char* bytes, std::size_t size)
auto categoryName = categoryMap["name"].as<std::string>();
std::transform(categoryName.begin(), categoryName.end(),
categoryName.begin(), ::tolower);
auto rowCount = categoryMap["rowCount"].as<int>();
auto columnsRaw = categoryMap["columns"].as<std::vector<msgpack::object>>();
auto& columns = categoriesData.m_dict[categoryName];
for (const auto& column : columnsRaw) {
Expand Down
5 changes: 1 addition & 4 deletions layer2/CifFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ using CIFData = std::variant<cif_detail::cif_str_data, cif_detail::bcif_data>;
@endverbatim
*/
class cif_file {
public: //
std::vector<char*> m_tokens;
std::map<std::string, cif_data> m_datablocks;
std::unique_ptr<char, pymol::default_free> m_contents;
Expand Down Expand Up @@ -177,7 +176,6 @@ class cif_array {
friend class cif_file;

private:
public: //
mutable std::string m_internal_str_cache;
std::variant<cif_detail::cif_str_array, cif_detail::bcif_array> m_array;

Expand Down Expand Up @@ -248,7 +246,7 @@ class cif_array {
* @param d default value for unknown/inapplicable elements
*/
const char* as_s(unsigned pos = 0, const char* d = "") const {
if (auto arr = std::get_if<cif_detail::cif_str_array>(&m_array)) {
if (std::get_if<cif_detail::cif_str_array>(&m_array)) {
return as(pos, d);
} else if (auto arr = std::get_if<cif_detail::bcif_array>(&m_array)) {
if (pos >= arr->m_arr.size())
Expand Down Expand Up @@ -319,7 +317,6 @@ namespace cif_detail {
class cif_data {
friend class cif_file;

public: //
CIFData m_data;

// generic default value
Expand Down

0 comments on commit 23bef14

Please sign in to comment.