refactor(tvix): getEnv(): Return std::optional
This allows distinguishing between an empty value and no value.
Patch ported from upstream at
ba87b08f85
Change-Id: I061cc8e16b1a7a0341adfc3b0edca1c0c51d5c97
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1884
Tested-by: BuildkiteCI
Reviewed-by: kanepyork <rikingcoding@gmail.com>
			
			
This commit is contained in:
		
							parent
							
								
									c5f3b12f04
								
							
						
					
					
						commit
						785cb3a754
					
				
					 17 changed files with 66 additions and 66 deletions
				
			
		
							
								
								
									
										2
									
								
								third_party/nix/src/libexpr/primops.cc
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								third_party/nix/src/libexpr/primops.cc
									
										
									
									
										vendored
									
									
								
							|  | @ -413,7 +413,7 @@ static void prim_getEnv(EvalState& state, const Pos& pos, Value** args, | |||
|   std::string name = state.forceStringNoCtx(*args[0], pos); | ||||
|   mkString(v, evalSettings.restrictEval || evalSettings.pureEval | ||||
|                   ? "" | ||||
|                   : getEnv(name)); | ||||
|                   : getEnv(name).value_or("")); | ||||
| } | ||||
| 
 | ||||
| /* Evaluate the first argument, then return the second argument. */ | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue