belliottsmith commented on code in PR #50: URL: https://github.com/apache/cassandra-accord/pull/50#discussion_r1241224628
########## accord-core/src/main/java/accord/utils/SimpleBitSet.java: ########## @@ -0,0 +1,348 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package accord.utils; + +import java.util.Arrays; + +import static java.lang.Long.highestOneBit; +import static java.lang.Long.lowestOneBit; +import static java.lang.Long.numberOfTrailingZeros; + +public class SimpleBitSet Review Comment: That involves unnecessary array allocations, but we could move to that. Hopefully hotspot will elide the allocations. There's also no equivalent of `prevSetBitNotBefore`, nor any equivalent of supplying the `ifNotFound` which each complicates logic. `forEach` also depends on `IntStream`, so we would be relying on HotSpot to elide these allocations, as well as any capturing lambda (which we explicitly avoid today by accepting `IndexedQuadConsumer`). `valueOf` also cannot be used by extending implementations, so there's no way to have an `ImmutableBitSet`, nor one that provides any of these facilities. Since this is written, is pretty simple and guarantees our requirements I'm strongly inclined to keep it, but I don't mind removing it if you both prefer that. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

