question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use bit flag instead of booleans in TestDrawableComponent

See original GitHub issue

We have a lot of booleans to configure the test components like callsShouldUpdateOnMount or implementsAccessibility. Instead of keeping the configuration flags as booleans we could have them as bit flags.

Code pointers

https://github.com/facebook/litho/blob/master/litho-testing/src/main/java/com/facebook/litho/testing/TestDrawableComponent.java

Point of contact: @mihaelao

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
anu0012commented, Apr 24, 2017

Hey @emilsjolander, I want to take up this issue. Can you guide me? Do we need to use bit flags just like it is used in InternalNode.java file?

https://github.com/facebook/litho/blob/master/litho-core/src/main/java/com/facebook/litho/InternalNode.java

0reactions
murazizcommented, Apr 26, 2017
Read more comments on GitHub >

github_iconTop Results From Across the Web

Why use flags+bitmasks rather than a series of booleans?
It was traditionally a way of reducing memory usage. So, yes, its quite obsolete in C# :-) As a programming technique, it may...
Read more >
O.1 — Bit flags and bit manipulation via std::bitset - Learn C++
When individual bits of an object are used as Boolean values, the bits are called bit flags. As an aside… In computing, a...
Read more >
Fast Bit Flag Boolean Expressions - Topten Software
An algorithm for converting boolean bit flag expressions to fast bit mask and test operations and even faster execution via dynamic IL method ......
Read more >
Bitmasks: A very esoteric (and impractical) way of managing ...
Using a bitmask means to query the bits found in some binary number. ... Let's say we have an object that stores booleans...
Read more >
Bitwise booleans in PHP - Stitcher.io
To represent these boundaries, I stored two boolean flags on the enum ... Instead of using a whole byte, we only need one...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found