Comments (6)
@JR-Morgan
Sure, just created a PR for you dev branch.
from speckle-sharp.
🤔 I think you're right, something's a bit fishy with this if block.
I wonder if we could remove the ContainsKey
check all together, and simply use Converted[appId] = conversionResult;
@connorivy what do you think?
from speckle-sharp.
Thanks for looking into this.
Not quite sure if this helps, but after changing the code block to this:
if (dict.ContainsKey)
dict[key] = value;
else
dict.Add(key, value)
my Revit project which I use for testing is converted much faster as before (because no exceptions are thrown, which added quite a lot of overhead to execution time).
Also, both parts of the if/else blocks are hit during debugging, so the logic does either add or change values.
Also, when the method is hit in my tests for the first, the dictionary itself is empty, so assignments won't work until some keys are added.
But I don't understand what the method is supposed to do at all, or what it's purpose is. Just thought I add this here to support you guys somehow.
from speckle-sharp.
If you change your code snippet to just:
dict[key] = value;
with no if check atall, does this still work for you?
from speckle-sharp.
@JR-Morgan
Sorry, my fault.
I was so used to writing the "if not contains key, then add, else assing" pattern in my own code, that I oversaw that the dictionary already has this build in when you assign a key directly as you proposed.
You are right, this will also work, sorry for the confusion.
from speckle-sharp.
No worries, I think we made the same mistake here.
Would you be comfortable submitting a PR to this repo with the same change?
from speckle-sharp.
Related Issues (20)
- Meshes in displayValue have area and volume as zero. HOT 2
- Enhancement: Integrating material_quantities into the ArchiCAD converter. HOT 2
- revit: cutback parameters not set for framing on receive HOT 1
- Compatibility with ETABS 21
- My Fake ticket, testing! HOT 6
- New issue
- ARCHICAD Converter: No BuildingMaterial for Windows and not all Components HOT 3
- ARCHICAD converter: Beams and columns do not have the profile information.
- Enhancement: Civil 3D Corridor Baseline and Cross Section Data HOT 2
- feat(archicad): Add support for openings
- feat(archicad): Add certification to "ConnectorArchicad.exe"
- feat(archicad): Update connector icon on Mac HOT 1
- feat(archicad): Add default commit message
- Civil connector will not allow selection of corridors to push
- Revit floors with slab shape points
- Bug: Rhino Converter throws an error when unnamed collections are filtered HOT 2
- Revit Connector: doesn't apply ParameterUpdater using applicationId HOT 1
- bug(Archicad): Properties of Objects not showing in viewer HOT 2
- Broken link to DesktopUI
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from speckle-sharp.