Skip to main content

luaur_analysis/methods/
anyification_is_dirty_anyification_alt_b.rs

1use crate::records::anyification::Anyification;
2use crate::records::free_type_pack::FreeTypePack;
3use crate::type_aliases::type_pack_id::TypePackId;
4
5impl Anyification {
6    /// `bool Anyification::isDirty(TypePackId tp)` (Anyification.cpp:54-62).
7    pub fn is_dirty_type_pack_id(&mut self, tp: TypePackId) -> bool {
8        if unsafe { (*tp).persistent } {
9            return false;
10        }
11
12        // C++: `if (log->getMutable<FreeTypePack>(tp)) return true; else return false;`
13        let log = self.base.base.log;
14        let ftp = unsafe { (*log).txn_log_get_mutable::<FreeTypePack, TypePackId>(tp) };
15        !ftp.is_null()
16    }
17}